X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fincludes%2Fstgdefs.h;h=0c67bfb060599624056489d164bcd5cc390ee4c5;hb=967cc47f37cb93a5e2b6df7822c9a646f0428247;hp=964cfced714425745e12d56cb25a12998328947d;hpb=7d5a924990d7856835762b18f86a383d661d4e54;p=ghc-hetmet.git diff --git a/ghc/includes/stgdefs.h b/ghc/includes/stgdefs.h index 964cfce..0c67bfb 100644 --- a/ghc/includes/stgdefs.h +++ b/ghc/includes/stgdefs.h @@ -5,7 +5,6 @@ #define STGDEFS_H /* machine/compiler/system dependencies :-( Must be first! */ -/* OLD: #include "platform.h" generated by configure */ #include "config.h" /* generated by configure */ #include "error.h" #include "StgMachDeps.h" @@ -33,17 +32,51 @@ void _stgAssert PROTO((char *, unsigned int)); #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 aix_TARGET_OS +/* for fd_set */ +#include +#endif + #ifdef NON_POSIX_SOURCE #undef _POSIX_SOURCE #undef _POSIX_C_SOURCE #else +# ifndef aix_TARGET_OS +/* already defined on aix */ #define _POSIX_SOURCE 1 +# endif +#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 + ( 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 ) */ + +#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 #include #endif @@ -181,23 +214,35 @@ void miniInterpret PROTO((StgFunPtr)); void miniInterpret_debug PROTO(( StgFunPtr, void(*)(STG_NO_ARGS) )); void miniInterpretEnd(STG_NO_ARGS); +/* UNUSED -- SOF 9/97 StgFunPtr evaluateMain(STG_NO_ARGS); StgFunPtr returnMain(STG_NO_ARGS); StgFunPtr impossible_jump_after_switch(STG_NO_ARGS); +*/ + +/* error handling for IO implementation*/ +extern int ghc_errno; +extern int ghc_errtype; +extern char *ghc_errstr; + +void cvtErrno (void); +void stdErrno (void); /* hooks: user might write some of their own */ -void ErrorHdrHook PROTO((FILE *)); +void ErrorHdrHook PROTO((StgInt)); void OutOfHeapHook PROTO((W_, W_)); +void OnExitHook (STG_NO_ARGS); void StackOverflowHook PROTO((I_)); #ifdef CONCURRENT -void NoRunnableThreadsHook (STG_NO_ARGS); +int NoRunnableThreadsHook (STG_NO_ARGS); #endif void MallocFailHook PROTO((I_, char *)); -void PatErrorHdrHook PROTO((FILE *)); -void PreTraceHook PROTO((FILE *)); -void PostTraceHook PROTO((FILE *)); +void PatErrorHdrHook PROTO((StgInt)); +void PreTraceHook PROTO((StgInt)); +void PostTraceHook PROTO((StgInt)); void defaultsHook (STG_NO_ARGS); void initEachPEHook (STG_NO_ARGS); +void IOErrorHdrHook PROTO((StgInt)); EXTFUN(startStgWorld); #ifdef CONCURRENT