Git development
 help / color / mirror / Atom feed
From: Jason Riedy <ejr@cs.berkeley.edu>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Set _ALL_SOURCE for AIX, but avoid its struct list.
Date: Mon, 15 Jan 2007 19:46:58 -0800	[thread overview]
Message-ID: <19211.1168919218@lotus.CS.Berkeley.EDU> (raw)
In-Reply-To: <7vbqkzzmve.fsf@assigned-by-dhcp.cox.net>

And Junio C Hamano writes:
> Yuck.

Yuck, thy name is AIX.

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

There's no equivalent to features.h...  And while this includes
a few repeats:
 bash-3.2$ find /usr/include/ -name \*.h|xargs fgrep -h \#ifdef|sort|uniq|wc -l
      402

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

Sure.

> 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...

I missed the suggestion altogether.  Sounds like the right thing
to do.

> 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.

The #ifdef _ALL_SOURCE in netdb.h comes right after the #endif of
#ifdef _XOPEN_SOURCE_EXTENDED.  So all doesn't really mean all,
just kinda sorta maybe some.

Yeah, AIX is a joy.  And thanks to DARPA and the DOE, it ain't
going away.  The following seems to work for me on Solaris 5.8
and AIX 5.3.

Jason, wishing they would all just see the light...

diff --git a/git-compat-util.h b/git-compat-util.h
index 8781e8e..edafb8e 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -13,10 +13,15 @@
 
 #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
+
+#if defined(_AIX)
+/* For AIX 5.3L, at the very least. */
+#define _ALL_SOURCE 1
+#define _XOPEN_SOURCE_EXTENDED 1
+#endif
 
 #include <unistd.h>
 #include <stdio.h>
@@ -45,7 +50,15 @@
 #include <arpa/inet.h>
 #include <netdb.h>
 #include <pwd.h>
+
+#if defined(_AIX)
+/* AIX 5.3L defines a struct list with _ALL_SOURCE. */
+#undef _ALL_SOURCE
+#endif
 #include <grp.h>
+#if defined(_AIX)
+#define _ALL_SOURCE 1
+#endif
 
 #ifndef NO_ICONV
 #include <iconv.h>

      reply	other threads:[~2007-01-16  3:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-16  1:34 [PATCH] Set _ALL_SOURCE for AIX, but avoid its struct list Jason Riedy
2007-01-16  3:11 ` Junio C Hamano
2007-01-16  3:46   ` Jason Riedy [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19211.1168919218@lotus.CS.Berkeley.EDU \
    --to=ejr@cs.berkeley.edu \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox