From: simonmar Date: Thu, 4 Jul 2002 13:33:25 +0000 (+0000) Subject: [project @ 2002-07-04 13:33:24 by simonmar] X-Git-Tag: nhc98-1-18-release~950 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;ds=sidebyside;h=68167dda4283c82f581b0960500d9711b49da31f;p=ghc-base.git [project @ 2002-07-04 13:33:24 by simonmar] 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. --- diff --git a/cbits/dirUtils.c b/cbits/dirUtils.c index d6ca576..8d94a45 100644 --- a/cbits/dirUtils.c +++ b/cbits/dirUtils.c @@ -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) diff --git a/include/HsBase.h b/include/HsBase.h index 1070aac..b7e3d02 100644 --- a/include/HsBase.h +++ b/include/HsBase.h @@ -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 * @@ -13,12 +13,6 @@ #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 #include