Using #undef correctly?

walt wa1ter at myrealbox.com
Thu Sep 21 13:07:15 PDT 2006


I'm trying to build the latest pkgsrc evolution, which fails:

e-timezone-dialog.c:83: error: 'timezone' redeclared as different kind of symbol
/usr/include/time.h:148: error: previous declaration of 'timezone' was here
e-timezone-dialog.c:83: error: 'timezone' redeclared as different kind of symbol
/usr/include/time.h:148: error: previous declaration of 'timezone' was here

That's not a cut-n-paste error -- those messages do appear twice, dunno why.

Here is the code:

#ifndef G_OS_WIN32 /* Declared properly in time.h already */
extern char *tzname[2];
#undef timezone             <------ I added this line!
extern long timezone;
extern int daylight;
#endif

DragonFly defines 'timezone' as a character string in <time.h> but linux
expect the number of seconds west of UTC (hence the long).

I'm not trying for a definitive fix here, I'm just puzzled why my added
'#undef' failed to change anything.

Cluestick, please?






More information about the Users mailing list