From: Jeff Garzik Date: Tue, 19 Dec 2006 20:02:02 GMT Subject: Re: [PATCH] index-pack usage of mmap() is unacceptably slower on many OSes other than Linux Message-ID: <4588453A.3060904@garzik.org> In-Reply-To: Linus Torvalds wrote: > diff --git a/convert-objects.c b/convert-objects.c > index 8812583..a630132 100644 > --- a/convert-objects.c > +++ b/convert-objects.c > @@ -1,7 +1,3 @@ > -#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 */ > -#define _GNU_SOURCE > -#include > #include "cache.h" > #include "blob.h" > #include "commit.h" > diff --git a/git-compat-util.h b/git-compat-util.h > index 0272d04..e619e29 100644 > --- a/git-compat-util.h > +++ b/git-compat-util.h > @@ -11,6 +11,10 @@ > > #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) > > +#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 */ > +#define _GNU_SOURCE > + > #include > #include > #include > @@ -25,6 +29,10 @@ > #include > #include > #include > +#include > +#include > +#include > +#include If you are going to do this, you have to audit -every- file, to make sure git-compat-util.h is -always- the first header. For example, builtin-mailinfo.c includes git-compat-util.h after ctype.h and iconv.h, which renders your #define _XOPEN_SOURCE 600 useless. /usr/include/features.h has already been included at that point. Jeff