#define STGDEFS_H
/* machine/compiler/system dependencies :-( Must be first! */
-#include "platform.h" /* generated by configure */
+/* OLD: #include "platform.h" generated by configure */
#include "config.h" /* generated by configure */
#include "error.h"
#include "StgMachDeps.h"
#define NON_POSIX_SOURCE
#endif
+/* If _NEXT_SOURCE is defined, certain header files make more
+ * constants visible to us.
+ * Perhaps it would have been wise, also to define NON_POSIX_SOURCE.
+ * Things seemed to work better without it however, so I have not
+ * done it. Nevertheless we do the signal stuff in a NON_POSIX way,
+ * see StgMacros.lh.
+ * CaS
+ */
+#ifdef nextstep3_TARGET_OS
+#define _NEXT_SOURCE
+#endif
+
#ifdef NON_POSIX_SOURCE
#undef _POSIX_SOURCE
#undef _POSIX_C_SOURCE
#else
#define _POSIX_SOURCE 1
+#ifndef irix_TARGET_OS
#define _POSIX_C_SOURCE 199301L
-/* Alphas set _POSIX_VERSION (unistd.h) */
-/* ditto _POSIX2_C_VERSION
- _POSIX2_VERSION
- _POSIX_4SOURCE
+#else
+/* defines contributed by Tomasz Cholewo <tjchol01@mecca.spd.louisville.edu>
+ ( this is with gcc-2.7.2 for irix-6.{2.3} ) .. hopefully they will not
+ upset anything under irix5 ..
+ */
+#define _POSIX_C_SOURCE 199309L
+#define __EXTENSIONS__
+#endif
+/* Bogus use of non-existent variable POSIX_C_SOURCE in the supplied header files
+ for gcc-2.7.1 on Solaris forces us to define it: (this strikes when using st_atime
+ and friends in <sys/stat.h> )
*/
+
+#if (__GNUC__ == 2) && (__GNUC_MINOR__ == 7)
+/* sigh, not possible to get at bugfix release number (fixed in 2.7.2) */
+#define POSIX_C_SOURCE _POSIX_C_SOURCE
+#endif
+
#include <unistd.h>
#include <signal.h>
#endif
/* end of hack */
#endif /* STDC_HEADERS */
-/*
- * threadWaitWrite# uses FD_SETSIZE to distinguish
- * between read file descriptors and write fd's.
- * Hence we need to include <sys/types.h>, but
- * is this the best place to do it?
- * (the following has been moved from libposix.h)
- */
-
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif /* HAVE_SYS_TYPES_H */
-
-#ifndef FD_SETSIZE
-#define FD_SETSIZE 1024
-#endif
-
#if ! defined(EXIT_SUCCESS) || ! defined(EXIT_FAILURE)
/* "stdlib.h" should have defined these; but at least
on SunOS 4.1.3, this is not so.
/* hooks: user might write some of their own */
void ErrorHdrHook PROTO((FILE *));
-void OutOfHeapHook PROTO((W_));
+void OutOfHeapHook PROTO((W_, W_));
void StackOverflowHook PROTO((I_));
#ifdef CONCURRENT
void NoRunnableThreadsHook (STG_NO_ARGS);
/* Saving and restoring registers */
#include "StgRegs.h"
+
+/*
+ * threadWaitWrite# uses FD_SETSIZE to distinguish
+ * between read file descriptors and write fd's.
+ * Hence we need to include <sys/types.h>, but
+ * is this the best place to do it?
+ * (the following has been moved from libposix.h)
+ */
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif /* HAVE_SYS_TYPES_H */
+
+#ifndef FD_SETSIZE
+# ifdef __FD_SETSIZE
+# define FD_SETSIZE __FD_SETSIZE
+# else /* cop out */
+# define FD_SETSIZE 1024
+# endif
+#endif
+
#endif /* ! STGDEFS_H */