libgo patch committed: Add #defines for Solaris

Submitted by Ian Taylor on Jan. 28, 2011, 12:11 a.m.

Details

Message ID mcry665naz5.fsf@google.com
State New
Headers show

Commit Message

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 hide | download patch | download mbox

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}