{"thread":{"id":"6396","subject":"[PATCH] Set _ALL_SOURCE for AIX, but avoid its struct list.","startedAt":"2007-01-16T01:34:49Z","lastAt":"2007-01-16T03:46:58Z","messageCount":3,"participants":["Jason Riedy","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"31792","messageId":"17466.1168911289@lotus.CS.Berkeley.EDU","threadId":"6396","inReplyTo":null,"subject":"[PATCH] Set _ALL_SOURCE for AIX, but avoid its struct list.","fromName":"Jason Riedy","fromEmail":"ejr@eecs.berkeley.edu","sentAt":"2007-01-16T01:34:49Z","receivedAt":"2007-01-16T01:34:49Z","isPatch":true,"sender":{"key":"ejr@eecs.berkeley.edu","avatar":"https://gravatar.com/avatar/547fa56f887cab01599edab4e9f813c949c1269e02714f20e0496c56185d9837?d=mp&s=160"},"body":"AIX 5.3 seems to need _ALL_SOURCE for struct addrinfo, but that\nintroduces a struct list in grp.h.\n\nSigned-off-by: Jason Riedy <ejr@cs.berkeley.edu>\n---\n  Also, the AIX iconv is insufficent.  All tests pass if I build\n  GNU libiconv, but using AIX's fails in many conversion tests.\n  If you build with NO_ICONV, all the conversion tests fail as\n  well.  I'm not sure if that should be changed, or if NO_ICONV\n  should be removed...\n\n git-compat-util.h |    3 +++\n 1 files changed, 3 insertions(+), 0 deletions(-)\n\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex 8781e8e..cbad411 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -15,6 +15,7 @@\n #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */\n #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */\n #endif\n+#define _ALL_SOURCE\n #define _GNU_SOURCE\n #define _BSD_SOURCE\n \n@@ -45,7 +46,9 @@\n #include <arpa/inet.h>\n #include <netdb.h>\n #include <pwd.h>\n+#undef _ALL_SOURCE /* AIX 5.3L defines a struct list with _ALL_SOURCE. */\n #include <grp.h>\n+#define _ALL_SOURCE\n \n #ifndef NO_ICONV\n #include <iconv.h>\n-- \n1.5.0.rc1.gf4b6c\n"},{"id":"31799","messageId":"7vbqkzzmve.fsf@assigned-by-dhcp.cox.net","threadId":"6396","inReplyTo":"17466.1168911289@lotus.CS.Berkeley.EDU","subject":"Re: [PATCH] Set _ALL_SOURCE for AIX, but avoid its struct list.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-16T03:11:49Z","receivedAt":"2007-01-16T03:11:49Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jason Riedy <ejr@EECS.Berkeley.EDU> writes:\n\n> AIX 5.3 seems to need _ALL_SOURCE for struct addrinfo, but that\n> introduces a struct list in grp.h.\n\nYuck.\n\nWhat the h**k is _ALL_SOURCE?  What are the valid other\npossibilities, _ALL_BINARY???\n\nI am wondering if we want to do \"#ifdef _AIX\" around truly yucky\nparts.\n\nI notice that I did not heed Linus's suggestion to define these\nto 1 to make them behave identically as \"cc -D_GNU_SOURCE\", by\nthe way...\n\nAlso I wonder if we do _ALL_SOURCE before any of the system\nheader files on AIX, if we still need \"_XOPEN_SOURCE_EXTENDED 1\"\nwhich we specifically added for AIX.\n\n\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex 8781e8e..75f8bc3 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -13,10 +13,10 @@\n \n #if !defined(__APPLE__) && !defined(__FreeBSD__)\n #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */\n-#define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */\n #endif\n-#define _GNU_SOURCE\n-#define _BSD_SOURCE\n+#define _GNU_SOURCE 1\n+#define _BSD_SOURCE 1\n+#define _ALL_SOURCE 1 /* AIX */\n \n #include <unistd.h>\n #include <stdio.h>\n@@ -45,7 +45,11 @@\n #include <arpa/inet.h>\n #include <netdb.h>\n #include <pwd.h>\n+\n+/* AIX 5.3L defines a struct list with _ALL_SOURCE. */\n+#undef _ALL_SOURCE\n #include <grp.h>\n+#define _ALL_SOURCE 1\n \n #ifndef NO_ICONV\n #include <iconv.h>\n"},{"id":"31802","messageId":"19211.1168919218@lotus.CS.Berkeley.EDU","threadId":"6396","inReplyTo":"7vbqkzzmve.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] Set _ALL_SOURCE for AIX, but avoid its struct list.","fromName":"Jason Riedy","fromEmail":"ejr@cs.berkeley.edu","sentAt":"2007-01-16T03:46:58Z","receivedAt":"2007-01-16T03:46:58Z","isPatch":true,"sender":{"key":"ejr@eecs.berkeley.edu","avatar":"https://gravatar.com/avatar/547fa56f887cab01599edab4e9f813c949c1269e02714f20e0496c56185d9837?d=mp&s=160"},"body":"And Junio C Hamano writes:\n> Yuck.\n\nYuck, thy name is AIX.\n\n> What the h**k is _ALL_SOURCE?  What are the valid other\n> possibilities, _ALL_BINARY???\n\nThere's no equivalent to features.h...  And while this includes\na few repeats:\n bash-3.2$ find /usr/include/ -name \\*.h|xargs fgrep -h \\#ifdef|sort|uniq|wc -l\n      402\n\n> I am wondering if we want to do \"#ifdef _AIX\" around truly yucky\n> parts.\n\nSure.\n\n> I notice that I did not heed Linus's suggestion to define these\n> to 1 to make them behave identically as \"cc -D_GNU_SOURCE\", by\n> the way...\n\nI missed the suggestion altogether.  Sounds like the right thing\nto do.\n\n> Also I wonder if we do _ALL_SOURCE before any of the system\n> header files on AIX, if we still need \"_XOPEN_SOURCE_EXTENDED 1\"\n> which we specifically added for AIX.\n\nThe #ifdef _ALL_SOURCE in netdb.h comes right after the #endif of\n#ifdef _XOPEN_SOURCE_EXTENDED.  So all doesn't really mean all,\njust kinda sorta maybe some.\n\nYeah, AIX is a joy.  And thanks to DARPA and the DOE, it ain't\ngoing away.  The following seems to work for me on Solaris 5.8\nand AIX 5.3.\n\nJason, wishing they would all just see the light...\n\ndiff --git a/git-compat-util.h b/git-compat-util.h\nindex 8781e8e..edafb8e 100644\n--- a/git-compat-util.h\n+++ b/git-compat-util.h\n@@ -13,10 +13,15 @@\n \n #if !defined(__APPLE__) && !defined(__FreeBSD__)\n #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */\n-#define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */\n #endif\n-#define _GNU_SOURCE\n-#define _BSD_SOURCE\n+#define _GNU_SOURCE 1\n+#define _BSD_SOURCE 1\n+\n+#if defined(_AIX)\n+/* For AIX 5.3L, at the very least. */\n+#define _ALL_SOURCE 1\n+#define _XOPEN_SOURCE_EXTENDED 1\n+#endif\n \n #include <unistd.h>\n #include <stdio.h>\n@@ -45,7 +50,15 @@\n #include <arpa/inet.h>\n #include <netdb.h>\n #include <pwd.h>\n+\n+#if defined(_AIX)\n+/* AIX 5.3L defines a struct list with _ALL_SOURCE. */\n+#undef _ALL_SOURCE\n+#endif\n #include <grp.h>\n+#if defined(_AIX)\n+#define _ALL_SOURCE 1\n+#endif\n \n #ifndef NO_ICONV\n #include <iconv.h>\n"}]}