X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=includes%2FStg.h;h=cae4a3a4aa9b984f5efba69e7d84a3c950f389d4;hp=b2051cbdd4623e620a3ff604ae78fb2c0c3a92ae;hb=HEAD;hpb=d20d32d788e2d6c088e6b03776c428df5bb004d3 diff --git a/includes/Stg.h b/includes/Stg.h index b2051cb..cae4a3a 100644 --- a/includes/Stg.h +++ b/includes/Stg.h @@ -61,6 +61,27 @@ that depend on config info, such as __USE_FILE_OFFSET64 */ #include +// On Solaris, we don't get the INFINITY and NAN constants unless we +// #define _STDC_C99, and we can't do that unless we also use -std=c99, +// because _STDC_C99 causes the headers to use C99 syntax (e.g. restrict). +// We aren't ready for -std=c99 yet, so define INFINITY/NAN by hand using +// the gcc builtins. +#if !defined(INFINITY) +#if defined(__GNUC__) +#define INFINITY __builtin_inf() +#else +#error No definition for INFINITY +#endif +#endif + +#if !defined(NAN) +#if defined(__GNUC__) +#define NAN __builtin_nan("") +#else +#error No definition for NAN +#endif +#endif + /* ----------------------------------------------------------------------------- Useful definitions -------------------------------------------------------------------------- */ @@ -183,6 +204,7 @@ typedef StgWord W_; typedef StgWord* P_; typedef StgInt I_; typedef StgWord StgWordArray[]; +typedef StgFunPtr F_; #define EI_(X) extern StgWordArray (X) GNU_ATTRIBUTE(aligned (8)) #define II_(X) static StgWordArray (X) GNU_ATTRIBUTE(aligned (8))