[project @ 2002-07-04 13:33:24 by simonmar]
authorsimonmar <unknown>
Thu, 4 Jul 2002 13:33:25 +0000 (13:33 +0000)
committersimonmar <unknown>
Thu, 4 Jul 2002 13:33:25 +0000 (13:33 +0000)
Sigh, enabling _POSIX_PTHREAD_SEMANTICS causes the Solaris header
files to drop several silly little C functions into the source code.
We don't want these duplicated in every Haskell-compiled object.

So plan B: just define _POSIX_PTHREAD_SEMANTICS in dirUtils.c where it
is needed to make readdir_r work.  I've checked, and readdir_r is the
only function we use that is affected by _POSIX_PTHREAD_SEMANTICS.  If
we ever use any more of these functions, then we'll have to be careful
to give them a C wrapper.

cbits/dirUtils.c
include/HsBase.h

index d6ca576..8d94a45 100644 (file)
@@ -3,6 +3,15 @@
  *
  * Directory Runtime Support
  */
+
+#include "config.h"
+
+// The following is required on Solaris to force the POSIX versions of
+// the various _r functions instead of the Solaris versions.
+#ifdef solaris2_TARGET_OS
+#define _POSIX_PTHREAD_SEMANTICS
+#endif
+
 #include "HsBase.h"
 
 #if defined(mingw32_TARGET_OS)
index 1070aac..b7e3d02 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: HsBase.h,v 1.8 2002/07/04 12:57:39 simonmar Exp $
+ * $Id: HsBase.h,v 1.9 2002/07/04 13:33:25 simonmar Exp $
  *
  * (c) The University of Glasgow 2001-2002
  *
 #include "config.h"
 #include "HsFFI.h"
 
-// The following is required on Solaris to force the POSIX versions of
-// the various _r functions instead of the Solaris versions.
-#ifdef solaris_TARGET_OS
-#define _POSIX_PTHREAD_SEMANTICS
-#endif
-
 #include <stdio.h>
 #include <stdlib.h>