git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] Support for HP NonStop
@ 2012-08-24 19:22 Joachim Schmitz
  2012-08-24 20:12 ` Junio C Hamano
  0 siblings, 1 reply; 7+ messages in thread
From: Joachim Schmitz @ 2012-08-24 19:22 UTC (permalink / raw)
  To: git

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 <strings.h> /* for strcasecmp() */
+#endif
#include <errno.h>
#include <limits.h>
#include <sys/param.h>
@@ -141,6 +145,10 @@
#else
#include <stdint.h>
#endif
+#ifdef __TANDEM /* or NO_INTPTR_T resp. NO_UINTPTR_T? */
+typedef int intptr_t;
+typedef unsigned int uintptr_t;
+#endif
#if defined(__CYGWIN__)
#undef _XOPEN_SOURCE
#include <grp.h>

The 1st hunk avoids a ‘is already defined with a different value warning, and I
believe this is the only and right way to fix this, but on the 2nd and 3rd hunk 
I’d need advice on how to properly add those. The #ifdef __TANDEM…#endif 
works fine for me, but doesn’t seem 100% clean to me.
In the comment I mention alternatives.

strcasecamp() is declared in <strings.h> as per C99/POSIX, and in C99 mode a prototype has 
to be seen by the compiler.

intptr_t and uintprt_t seem to be optional in C99 and are not provided for NonStop

What do you think?

Bye, Jojo

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-09-19  8:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-24 19:22 [RFC] Support for HP NonStop Joachim Schmitz
2012-08-24 20:12 ` Junio C Hamano
2012-08-24 20:43   ` Joachim Schmitz
2012-08-24 21:50     ` Junio C Hamano
2012-08-25  8:03       ` Joachim Schmitz
2012-09-19  7:24     ` Jan Engelhardt
2012-09-19  8:16       ` Joachim Schmitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).