git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH FYI 2/5] git-compat-util.h: adjust for SGI IRIX 6.5

From
Brandon Casey <casey@nrlssc.navy.mil>
Date
Jul 10, 2009, 17:10 UTC
Message-ID
<39niBtmtFs5Sy_fjtaztVioF-DSUgPaeb2z2kLxvo9ZK1x9ZQKe11vCjlSyOtjKf_tm_u4WsJQY@cipher.nrlssc.navy.mil>
In-Reply-To
<39niBtmtFs5Sy_fjtaztVmZBc5gMLjrIQhevVkHr5EAuPYiuRd5i__yABkFEZOZNG-W8HrgSclE@cipher.nrlssc.navy.mil>

Don't define _XOPEN_SOURCE Do define _SGI_SOURCE

Defining _XOPEN_SOURCE prevents many of the common functions and macros
from being defined. _Not_ setting _XOPEN_SOURCE, and instead setting
_SGI_SOURCE, provides all of the XPG4, XPG5, BSD, POSIX functions and
declarations, _BUT_ provides a horribly broken snprintf(). SGI does have
a working snprintf(), but it is only provided when _NO_XOPEN5 evaluates
to zero, and this only happens if _XOPEN_SOURCE is defined which, as
mentioned above, prevents many other common functions and defines.
---
 git-compat-util.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/git-compat-util.h b/git-compat-util.h
index 9609eaa..913f41a 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -52,7 +52,7 @@
 # else
 # define _XOPEN_SOURCE 500
 # endif
-#elif !defined(__APPLE__) && !defined(__FreeBSD__)  && !defined(__USLC__) && !defined(_M_UNIX)
+#elif !defined(__APPLE__) && !defined(__FreeBSD__)  && !defined(__USLC__) && !defined(_M_UNIX) && !defined(sgi)
 #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
 #ifndef __sun__
 #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
@@ -62,6 +62,7 @@
 #define _GNU_SOURCE 1
 #define _BSD_SOURCE 1
 #define _NETBSD_SOURCE 1
+#define _SGI_SOURCE 1
 
 #include <unistd.h>
 #include <stdio.h>
-- 
1.6.4.rc0.5.g76f7cf
Previous: Brandon CaseyNext: Brandon Casey
Message 3 of 8 in “How I compile on IRIX 6.5 with the MIPSpro compiler and ksh”
  1. 0/5 How I compile on IRIX 6.5 with the MIPSpro compiler and kshBrandon Casey, Jul 10, 2009
  2. 1/5 unpack-trees.c: work around run-time array initialization flaw on IRIX 6.5Brandon Casey, Jul 10, 2009
  3. 2/5 git-compat-util.h: adjust for SGI IRIX 6.5Brandon Casey, Jul 10, 2009
  4. 3/5 Makefile: add NEEDS_LIBGEN to optionally add -lgen to compile argumentsBrandon Casey, Jul 10, 2009
  5. 4/5 Makefile: add section for SGI IRIX 6.5Brandon Casey, Jul 10, 2009
  6. 5/5 test-lib.sh: work around ksh's trap shortcomingsBrandon Casey, Jul 10, 2009
  7. 6/5 Makefile: update IRIX64 sectionBrandon Casey, Jul 10, 2009
  8. Junio C HamanoJul 11, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.