Skip to content

Commit 9398b85

Browse files
drafnelgitster
authored andcommitted
git-compat-util.h: adjust for SGI IRIX 6.5
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. The broken snprintf will be worked around with SNPRINTF_RETURNS_BOGUS in the Makefile in a later patch. Signed-off-by: Brandon Casey <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0039ba7 commit 9398b85

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

git-compat-util.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
# else
5353
# define _XOPEN_SOURCE 500
5454
# endif
55-
#elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && !defined(_M_UNIX)
55+
#elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && !defined(_M_UNIX) && !defined(sgi)
5656
#define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */
5757
#ifndef __sun__
5858
#define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */
@@ -62,6 +62,7 @@
6262
#define _GNU_SOURCE 1
6363
#define _BSD_SOURCE 1
6464
#define _NETBSD_SOURCE 1
65+
#define _SGI_SOURCE 1
6566

6667
#include <unistd.h>
6768
#include <stdio.h>

0 commit comments

Comments
 (0)