Re: [PATCH] Set _ALL_SOURCE for AIX, but avoid its struct list.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jason Riedy <ejr@xxxxxxxxxxxxxxxxx> writes:

> AIX 5.3 seems to need _ALL_SOURCE for struct addrinfo, but that
> introduces a struct list in grp.h.

Yuck.

What the h**k is _ALL_SOURCE?  What are the valid other
possibilities, _ALL_BINARY???

I am wondering if we want to do "#ifdef _AIX" around truly yucky
parts.

I notice that I did not heed Linus's suggestion to define these
to 1 to make them behave identically as "cc -D_GNU_SOURCE", by
the way...

Also I wonder if we do _ALL_SOURCE before any of the system
header files on AIX, if we still need "_XOPEN_SOURCE_EXTENDED 1"
which we specifically added for AIX.


diff --git a/git-compat-util.h b/git-compat-util.h
index 8781e8e..75f8bc3 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -13,10 +13,10 @@
 
 #if !defined(__APPLE__) && !defined(__FreeBSD__)
 #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
-#define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
 #endif
-#define _GNU_SOURCE
-#define _BSD_SOURCE
+#define _GNU_SOURCE 1
+#define _BSD_SOURCE 1
+#define _ALL_SOURCE 1 /* AIX */
 
 #include <unistd.h>
 #include <stdio.h>
@@ -45,7 +45,11 @@
 #include <arpa/inet.h>
 #include <netdb.h>
 #include <pwd.h>
+
+/* AIX 5.3L defines a struct list with _ALL_SOURCE. */
+#undef _ALL_SOURCE
 #include <grp.h>
+#define _ALL_SOURCE 1
 
 #ifndef NO_ICONV
 #include <iconv.h>

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]