X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=includes%2FStg.h;h=022b385e2def91a8d5b961ae0c02c4850cae4be6;hb=bb7ffa1642e2110e26e1243c42a8a24adafa985d;hp=6ddf17a0a07e201dee8791f0c945dc8bf18870e6;hpb=c245355e6f2c7b7c95e9af910c4d420e13af9413;p=ghc-hetmet.git diff --git a/includes/Stg.h b/includes/Stg.h index 6ddf17a..022b385 100644 --- a/includes/Stg.h +++ b/includes/Stg.h @@ -31,6 +31,9 @@ */ #ifndef IN_STG_CODE # define IN_STG_CODE 1 +# define _ISOC99_SOURCE +// Turn on C99 for .hc code. This gives us the INFINITY and NAN +// constants from math.h, which we occasionally need to use in .hc (#1861) #endif #if IN_STG_CODE == 0 @@ -72,21 +75,41 @@ /* * 'Portable' inlining: - * INLINE_HEADER is for inline functions in header files + * INLINE_HEADER is for inline functions in header files (macros) * STATIC_INLINE is for inline functions in source files + * EXTERN_INLINE is for functions that we want to inline sometimes */ #if defined(__GNUC__) || defined( __INTEL_COMPILER) + # define INLINE_HEADER static inline # define INLINE_ME inline # define STATIC_INLINE INLINE_HEADER + +# if defined(KEEP_INLINES) +# define EXTERN_INLINE inline +# else +# define EXTERN_INLINE extern inline +# endif + #elif defined(_MSC_VER) + # define INLINE_HEADER __inline static # define INLINE_ME __inline # define STATIC_INLINE INLINE_HEADER + +# if defined(KEEP_INLINES) +# define EXTERN_INLINE __inline +# else +# define EXTERN_INLINE __inline extern +# endif + #else + # error "Don't know how to inline functions with your C compiler." + #endif + /* * GCC attributes */ @@ -102,6 +125,12 @@ #define GNUC3_ATTRIBUTE(at) #endif +#if __GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ >= 3 +#define GNUC_ATTR_HOT __attribute__((hot)) +#else +#define GNUC_ATTR_HOT /* nothing */ +#endif + #define STG_UNUSED GNUC3_ATTRIBUTE(__unused__) /* ----------------------------------------------------------------------------- @@ -154,6 +183,10 @@ typedef StgWord StgWordArray[]; #include "MachRegs.h" #include "Regs.h" +#ifdef TICKY_TICKY +#include "TickyCounters.h" +#endif + #if IN_STG_CODE /* * This is included later for RTS sources, after definitions of