Reduced number of problems with samba-2.0.7pre3

Nicolas Williams Nicolas.Williams at wdr.com
Mon Apr 3 18:43:14 GMT 2000


On Tue Apr 04 200, David Collier-Brown - Sun Canada wrote:
> Drat! 
> when compiling with Sun's SC5.0 compilers, and with 
> --with-smbwrapper, I get this one again: 
> 
> ---
> Compiling smbwrapper/wrapped.c with -Kpic
> "smbwrapper/wrapped.c", line 466: identifier redeclared: utimes
>         current : function(pointer to char, pointer to void) returning int
>         previous: function(pointer to const char, pointer to const struct 
> timeval {long tv_sec, long tv_usec}) returning int : "/usr/include/sys/time.h", 
> line 328
> ---
> This is a fatal error, (ie, it claims the ABI changed)
> --dave
> --
> David Collier-Brown in Boston
> Phone: (781) 442-0734, Room BUR03-3632
> 

Funny, even with GCC, I get that redeclaration error on Solaris 8 (but
not on 2.6!).

config.h is configured the same on both platforms.

What I did to fix this was to add "#define _SYS_TIME_H" before including
includes.h in wapped.c. This fixes the problem, though it adds a warning
about select() and struct timeval (but since those are not involved in
wrapped.c it's just a warning).

Perhaps this bit from the Solaris 8 <sys/time.h> can elucidate this
problem:

#if (!defined(_KERNEL) && !defined(_POSIX_C_SOURCE) && \
        !defined(_XOPEN_SOURCE)) || defined(__EXTENSIONS__) || defined(_XPG4_2)

#if defined(__STDC__)

int getitimer(int, struct itimerval *);
int utimes(const char *, const struct timeval *);
#if defined(_XPG4_2)
int setitimer(int, const struct itimerval *, struct itimerval *);
#else
int setitimer(int, struct itimerval *, struct itimerval *);
#endif /* defined(_XPG2_2) */

#else /* __STDC__ */

int gettimer();
int settimer();
int utimes();

#endif /* __STDC__ */
#endif /* !defined(_KERNEL) ... defined(_XPG4_2) */


I.e., perhaps we can put in some defines before including includes.h in
wrapped.c that leaves the declaration of utimes out.

Sigh.

Nico
--



More information about the samba-technical mailing list