]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Fix checks for minimum required compiler versions.
authorMike Pall <mike>
Tue, 28 Sep 2010 12:20:49 +0000 (14:20 +0200)
committerMike Pall <mike>
Tue, 28 Sep 2010 12:20:49 +0000 (14:20 +0200)
src/lj_arch.h
src/lj_def.h

index 54725dcf3bab4dbfdcd7dbbb72cfe55fe24a2488..a0f08a222d8b2fe55866f82cfd17251c055cc943 100644 (file)
 #error "No target architecture defined"
 #endif
 
+/* Check for minimum required compiler versions. */
+#if defined(__GNUC__)
+#if LJ_TARGET_X64
+#if __GNUC__ < 4
+#error "Need at least GCC 4.0 or newer"
+#endif
+#elif LJ_TARGET_PPC
+#if (__GNUC__ < 4) || ((__GNUC__ == 4) && __GNUC_MINOR__ < 3)
+#error "Need at least GCC 4.3 or newer"
+#endif
+#else
+#if (__GNUC__ < 3) || ((__GNUC__ == 3) && __GNUC_MINOR__ < 4)
+#error "Need at least GCC 3.4 or newer"
+#endif
+#endif
+#endif
+
 /* Check target-specific constraints. */
 #ifndef _BUILDVM_H
 #if LJ_TARGET_PPC
index f6b5432d9dd863a3790476878b205147c8081ebb..bc3ae937fef1f8fddcef7057fd6631dec42ff66a 100644 (file)
@@ -104,10 +104,6 @@ typedef uintptr_t BloomFilter;
 
 #if defined(__GNUC__)
 
-#if (__GNUC__ < 3) || ((__GNUC__ == 3) && __GNUC_MINOR__ < 4)
-#error "sorry, need GCC 3.4 or newer"
-#endif
-
 #define LJ_NORET       __attribute__((noreturn))
 #define LJ_ALIGN(n)    __attribute__((aligned(n)))
 #define LJ_INLINE      inline
@@ -140,7 +136,7 @@ static LJ_AINLINE uint32_t lj_fls(uint32_t x)
 #define lj_fls(x)      ((uint32_t)(__builtin_clz(x)^31))
 #endif
 
-#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 3
+#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
 static LJ_AINLINE uint32_t lj_bswap(uint32_t x)
 {
   return (uint32_t)__builtin_bswap32((int32_t)x);