projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix warnings in StgCmmForeign
[ghc-hetmet.git]
/
includes
/
Stg.h
diff --git
a/includes/Stg.h
b/includes/Stg.h
index
6cbfeb4
..
394c987
100644
(file)
--- a/
includes/Stg.h
+++ b/
includes/Stg.h
@@
-35,9
+35,6
@@
// 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)
# 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)
# define _ISOC99_SOURCE
-
-// Turning on _ISOC99_SOURCE means S_ISSOCK gets defined on Linux
-# define _BSD_SOURCE
#endif
#if IN_STG_CODE == 0
#endif
#if IN_STG_CODE == 0
@@
-77,6
+74,10
@@
#define BITS_PER_BYTE 8
#define BITS_IN(x) (BITS_PER_BYTE * sizeof(x))
#define BITS_PER_BYTE 8
#define BITS_IN(x) (BITS_PER_BYTE * sizeof(x))
+/* Compute offsets of struct fields
+ */
+#define FIELD_OFFSET(s_type, field) ((StgWord)&(((s_type*)0)->field))
+
/*
* 'Portable' inlining:
* INLINE_HEADER is for inline functions in header files (macros)
/*
* 'Portable' inlining:
* INLINE_HEADER is for inline functions in header files (macros)
@@
-95,7
+96,11
@@
// __attribute__((gnu_inline)). So when we don't have this, we use
// ordinary static inline.
//
// __attribute__((gnu_inline)). So when we don't have this, we use
// ordinary static inline.
//
-#if defined(__GNUC_GNU_INLINE__)
+// Apple's gcc defines __GNUC_GNU_INLINE__ without providing
+// gnu_inline, so we exclude MacOS X and fall through to the safe
+// version.
+//
+#if defined(__GNUC_GNU_INLINE__) && !defined(__APPLE__)
# if defined(KEEP_INLINES)
# define EXTERN_INLINE inline
# else
# if defined(KEEP_INLINES)
# define EXTERN_INLINE inline
# else