git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 6/10] Fix header breakage with _XOPEN_SOURCE.
@ 2006-08-02  1:03 Ramsay Jones
  2006-08-02  7:46 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Ramsay Jones @ 2006-08-02  1:03 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 1144 bytes --]

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>
---
 convert-objects.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/convert-objects.c b/convert-objects.c
index 0fabd89..971ad6d 100644
--- a/convert-objects.c
+++ b/convert-objects.c
@@ -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"
-- 
1.4.1

[-- Attachment #2: P0006.TXT --]
[-- Type: text/plain, Size: 1371 bytes --]

From 72f745c4c1e366a0f1fc75ec8da55a3cfb5457c7 Mon Sep 17 00:00:00 2001
From: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk>
Date: Sun, 30 Jul 2006 16:52:09 +0100
Subject: [PATCH 6/10] Fix header breakage with _XOPEN_SOURCE.

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>
---
 convert-objects.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/convert-objects.c b/convert-objects.c
index 0fabd89..971ad6d 100644
--- a/convert-objects.c
+++ b/convert-objects.c
@@ -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"
-- 
1.4.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-08-05 17:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-02  1:03 [PATCH 6/10] Fix header breakage with _XOPEN_SOURCE Ramsay Jones
2006-08-02  7:46 ` Junio C Hamano
2006-08-02 18:47   ` Ramsay Jones
2006-08-04  0:19     ` Johannes Schindelin
2006-08-05 17:11       ` Ramsay Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).