From: Junio C Hamano Date: Fri, 24 Aug 2012 20:12:52 GMT Subject: Re: [RFC] Support for HP NonStop Message-ID: <7v4nnsyrp7.fsf@alter.siamese.dyndns.org> In-Reply-To: <005501cd822d$bf844bb0$3e8ce310$@schmitz-digital.de> "Joachim Schmitz" writes: > Hi folks > > On top of the patches I’ve submitted so far, which were needed for HP NonStop, > but possibly useful for other platforms too, here is one that is at least in parts NonStop specific > > diff --git a/git-compat-util.h b/git-compat-util.h > index a047221..d6a142a 100644 > --- a/git-compat-util.h > +++ b/git-compat-util.h > @@ -74,7 +74,8 @@ > # define _XOPEN_SOURCE 500 > # endif > #elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && \ > -      !defined(_M_UNIX) && !defined(__sgi) && !defined(__DragonFly__) > +      !defined(_M_UNIX) && !defined(__sgi) && !defined(__DragonFly__) && \ > +      !defined(__TANDEM) > #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 fo > #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */ > #endif > +#ifdef __TANDEM /* or HAVE_STRINGS_H ? */ > +#include /* for strcasecmp() */ > +#endif > #include > #include > #include Yeah, it appears that glibc headers have strcasecmp() and friends in the and that was why majority of us were fine without including . A cursory look of /usr/include/strings.h on a GNU system suggests that it is safe to include after we incude on that platform. I think it is OK to leave it "__TANDEM /* or HAVE_STRINGS_H? */" for now and let the next person who wants to port us to a platform that needs this inclusion turn it to HAVE_STRINGS_H. Alternatively, we bite the bullet now and include on any platform that has the header file and see if anybody complains (that reminds me; I at least should get one flavor of BSD build environment for this kind of thing myself). > @@ -141,6 +145,10 @@ > #else > #include > #endif > +#ifdef __TANDEM /* or NO_INTPTR_T resp. NO_UINTPTR_T? */ > +typedef int intptr_t; > +typedef unsigned int uintptr_t; > +#endif A bit wider context for this hunk is #ifndef NO_INTTYPES_H #include #else #include #endif So we have been assuming that has intptr_t but __TANDEM apparently doesn't. POSIX requires intptr_t and uintptr_t to be declared for systems conforming to XSI, but otherwise these are optional (in other words, some XSI non-conforming platforms may have them in ), so it would not help to check _XOPEN_UNIX to see if the system is XSI X-<. We would need NO_INTPTR_T as you hinted above, perhaps like this. #ifndef NO_INTTYPES_H #include #else #include #endif #ifdef NO_INTPTR_T typedef int intptr_t; typedef unsigned int uintptr_t; #endif By the way, is "int" wide enough, or should they be "long"?