aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2010-09-28 14:20:49 +0200
committerMike Pall <mike>2010-09-28 14:20:49 +0200
commita500752787c3ea177cd4bf56bb795f9c513dbd4c (patch)
tree19e7b52da26223ae1f2f476995d160fed2ea76b5 /src
parentf635e3e5bbaa76fecc84ed5bb1d4855220b4a08a (diff)
downloadluajit-a500752787c3ea177cd4bf56bb795f9c513dbd4c.tar.gz
luajit-a500752787c3ea177cd4bf56bb795f9c513dbd4c.tar.bz2
luajit-a500752787c3ea177cd4bf56bb795f9c513dbd4c.zip
Fix checks for minimum required compiler versions.
Diffstat (limited to 'src')
-rw-r--r--src/lj_arch.h17
-rw-r--r--src/lj_def.h6
2 files changed, 18 insertions, 5 deletions
diff --git a/src/lj_arch.h b/src/lj_arch.h
index 54725dcf..a0f08a22 100644
--- a/src/lj_arch.h
+++ b/src/lj_arch.h
@@ -86,6 +86,23 @@
86#error "No target architecture defined" 86#error "No target architecture defined"
87#endif 87#endif
88 88
89/* Check for minimum required compiler versions. */
90#if defined(__GNUC__)
91#if LJ_TARGET_X64
92#if __GNUC__ < 4
93#error "Need at least GCC 4.0 or newer"
94#endif
95#elif LJ_TARGET_PPC
96#if (__GNUC__ < 4) || ((__GNUC__ == 4) && __GNUC_MINOR__ < 3)
97#error "Need at least GCC 4.3 or newer"
98#endif
99#else
100#if (__GNUC__ < 3) || ((__GNUC__ == 3) && __GNUC_MINOR__ < 4)
101#error "Need at least GCC 3.4 or newer"
102#endif
103#endif
104#endif
105
89/* Check target-specific constraints. */ 106/* Check target-specific constraints. */
90#ifndef _BUILDVM_H 107#ifndef _BUILDVM_H
91#if LJ_TARGET_PPC 108#if LJ_TARGET_PPC
diff --git a/src/lj_def.h b/src/lj_def.h
index f6b5432d..bc3ae937 100644
--- a/src/lj_def.h
+++ b/src/lj_def.h
@@ -104,10 +104,6 @@ typedef uintptr_t BloomFilter;
104 104
105#if defined(__GNUC__) 105#if defined(__GNUC__)
106 106
107#if (__GNUC__ < 3) || ((__GNUC__ == 3) && __GNUC_MINOR__ < 4)
108#error "sorry, need GCC 3.4 or newer"
109#endif
110
111#define LJ_NORET __attribute__((noreturn)) 107#define LJ_NORET __attribute__((noreturn))
112#define LJ_ALIGN(n) __attribute__((aligned(n))) 108#define LJ_ALIGN(n) __attribute__((aligned(n)))
113#define LJ_INLINE inline 109#define LJ_INLINE inline
@@ -140,7 +136,7 @@ static LJ_AINLINE uint32_t lj_fls(uint32_t x)
140#define lj_fls(x) ((uint32_t)(__builtin_clz(x)^31)) 136#define lj_fls(x) ((uint32_t)(__builtin_clz(x)^31))
141#endif 137#endif
142 138
143#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 139#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
144static LJ_AINLINE uint32_t lj_bswap(uint32_t x) 140static LJ_AINLINE uint32_t lj_bswap(uint32_t x)
145{ 141{
146 return (uint32_t)__builtin_bswap32((int32_t)x); 142 return (uint32_t)__builtin_bswap32((int32_t)x);