Fix header breakage with _XOPEN_SOURCE.
authorRamsay Allan Jones <ramsay@ramsay1.demon.co.uk>
Sun, 30 Jul 2006 15:52:09 +0000 (16:52 +0100)
committerJunio C Hamano <junkio@cox.net>
Wed, 2 Aug 2006 07:27:48 +0000 (00:27 -0700)
convert-objects.c sets _XOPEN_SOURCE and _XOPEN_SOURCE_EXTENDED before
including <time.h>, in order to get the declaration of strptime().
This leads to breakage in cache.h, due to S_ISLNK and S_IFLNK no longer
being defined by <sys/stat.h>. These definitions are protected by the
__USE_BSD symbol, which is not set when _XOPEN_SOURCE is set. Moving
the #defines and #include <time.h> below all other #includes does not
fix the problem, however, since now _USE_XOPEN, which protects the
declaration of strptime(), is now not defined (don't ask!).

The fix is to #define _GNU_SOURCE, which enables the definition of
practically everything.

Signed-off-by: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
convert-objects.c
index ebea8e472bb2eede02219999b0cfd9a63f211d4b..168771ed857dd9e95b1e14da40f1e39d18f7b2cf 100644 (file)
@@ -1,5 +1,6 @@
 #define _XOPEN_SOURCE 500 /* glibc2 and AIX 5.3L need this */
 #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
+#define _GNU_SOURCE
 #include <time.h>
 #include "cache.h"
 #include "blob.h"