Patchwork libgo patch committed: Add #defines for Solaris

login
register
mail settings
Submitter Ian Taylor
Date Jan. 28, 2011, 12:11 a.m.
Message ID <mcry665naz5.fsf@google.com>
Download mbox | patch
Permalink /patch/80758/
State New
Headers show

Comments

Ian Taylor - Jan. 28, 2011, 12:11 a.m.
This patch to mksysinfo.sh adds #defines for Solaris to pick up required
struct definitions.  Bootstrapped on x86_64-unknown-linux-gnu.
Committed to mainline.

Ian

Patch

diff -r ca259e1cb993 libgo/mksysinfo.sh
--- a/libgo/mksysinfo.sh	Thu Jan 27 15:59:53 2011 -0800
+++ b/libgo/mksysinfo.sh	Thu Jan 27 16:07:11 2011 -0800
@@ -24,6 +24,14 @@ 
 rm -f sysinfo.c
 cat > sysinfo.c <<EOF
 #include "config.h"
+
+#define _GNU_SOURCE
+#if defined(__sun__) && defined(__svr4__)
+/* Needed by Solaris header files.  */
+#define _XOPEN_SOURCE 600
+#define _EXTENSIONS_
+#endif
+
 #include <sys/types.h>
 #include <dirent.h>
 #include <errno.h>
@@ -56,7 +64,7 @@ 
 #include <unistd.h>
 EOF
 
-${CC} -D_GNU_SOURCE -fdump-go-spec=gen-sysinfo.go -S -o sysinfo.s sysinfo.c
+${CC} -fdump-go-spec=gen-sysinfo.go -S -o sysinfo.s sysinfo.c
 
 echo 'package syscall' > ${OUT}