diff src/s/sol2.h @ 163:0132846995bd r20-3b8

Import from CVS: tag r20-3b8
author cvs
date Mon, 13 Aug 2007 09:43:35 +0200
parents 6b37e6ddd302
children 85ec50267440
line wrap: on
line diff
--- a/src/s/sol2.h	Mon Aug 13 09:42:28 2007 +0200
+++ b/src/s/sol2.h	Mon Aug 13 09:43:35 2007 +0200
@@ -1,9 +1,32 @@
 /* Synched up with: FSF 19.31. */
 
-#define __EXTENSIONS__
-#include "usg5-4-2.h"		/* XEmacs change from 5-4 to 5-4-2 */
+#define __EXTENSIONS__ 1
+#define SOLARIS2 1
+#define POSIX 1
+#if 1
+#ifndef USG
+#define USG
+#endif
+#ifndef USG5_4
+#define USG5_4
+#endif
+#if 0
+#undef  SYSTEM_TYPE
+#define SYSTEM_TYPE "solaris"
+#endif
+#undef  _POSIX_C_SOURCE
+#if 0
+#define _POSIX_C_SOURCE 199506L
+#endif
+#undef  _XOPEN_SOURCE
+#define _XOPEN_SOURCE 1
+#undef  _XOPEN_SOURCE_EXTENDED
+#define _XOPEN_SOURCE_EXTENDED 1
+#endif
 
-#define SOLARIS2
+#if 1 /* mrb */
+#include "usg5-4-2.h"	/* XEmacs change from 5-4 to 5-4-2 */
+#endif
 
 /* SIGIO seems to be working under Solaris and it makes ^G work better... */
 #undef BROKEN_SIGIO
@@ -13,13 +36,8 @@
 #undef BROKEN_TIOCGETC
 #undef BROKEN_TIOCGWINSZ
 
-/* This triggers a conditional in xfaces.c.  */
-#define XOS_NEEDS_TIME_H
-
-#define POSIX
-
 #ifdef NOT_C_CODE
-
+#define ORDINARY_LINK
 /* XEmacs change -- some Motif packages need -lgen to get regex and regcmp */
 
 #undef LIBS_SYSTEM
@@ -38,19 +56,60 @@
  */
 
 #undef UNEXEC
+#if OS_RELEASE < 56
 #define UNEXEC "unexsol2.o"
+#else
+#define UNEXEC "unexsol2-6.o"
+#endif
 
 #else /* C_CODE */
-/* The standard Solaris library nsl has this function in it which is
-   supposed to only be in the BSD compat stuff.  Yuck.  Of course,
-   there isn't a prototype for it other than in /usr/ucbinclude. */
-int gethostname (char *, size_t);
+
+#if OS_RELEASE <= 53
+/* Solaris 2.3 has a bug in XListFontsWithInfo.  */
+#define BROKEN_XLISTFONTSWITHINFO
+#endif
+
+/* 2.5 now has random back in libc but we don't want to use it. */
+#if OS_RELEASE >= 55
+#undef HAVE_RANDOM
+/* Apparently not necessary here, and it causes 10% CPU chewage. */
+#undef BROKEN_SIGCHLD
+#endif /* >= SunOS 5.5 */
+
+/* XEmacs addition: Raymond Toy says XEmacs completely misses SIGCHLD
+   when compiled with GCC 2.7.0 (but not, apparently, with SunPro C?),
+   X11R6, and Solaris 2.4.
+
+   Someone else submitted a simple test program that duplicates this
+   behavior, and says it has something to do with the fact that X11R6
+   links with the threads library. */
+
+#ifdef THIS_IS_X11R6
+#define BROKEN_SIGCHLD
+#endif
+
+#if OS_RELEASE == 55
+/* Solaris 2.5 is the first Solaris that has getpagesize(), srandom()
+   and random(), but they forgot to add prototypes to the header
+   files. */
+int getpagesize (void);
+long random (void);
+void srandom (unsigned int seed);
+#endif /* SunOS 5.5 */
+
+#if OS_RELEASE < 55
 /* Another missing prototype, added in Solaris 2.5 */
 extern void *__builtin_alloca(size_t);
+#endif /* before SunOS 5.5 */
 
+#if OS_RELEASE < 56
 /* XEmacs: Solaris include files miss this. */
 struct timeval;
 int utimes (char *file, struct timeval *tvp);
+extern int gethostname(char *, unsigned);
+#endif /* before SunOS 5.6 */
+
+#include <sys/utsname.h> /* warning: macro redefined: SYS_NMLN */
 
 /* Get non-ANSI functions from ANSI header files in cc -Xc mode.
    Sun has promised to fix setjmp.h */
@@ -64,4 +123,5 @@
    least under 2.4 */
 #undef _setjmp
 #define _setjmp setjmp
+
 #endif /* C_CODE */