瀏覽代碼

Fix #230: Fix all GCC version checks this time.

Check GNUC > 4 according to Red54 (the original author of patch #230).
bel 9 年之前
父節點
當前提交
31c19f74a5
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/civetweb.c

+ 2 - 2
src/civetweb.c

@@ -1254,7 +1254,7 @@ mg_atomic_inc(volatile int *addr)
 	 * so whatever you use, the other SDK is likely to raise a warning. */
 	ret = InterlockedIncrement((volatile long *)addr);
 #elif defined(__GNUC__)                                                        \
-    && (__GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ > 0))
+    && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 0)))
 	ret = __sync_add_and_fetch(addr, 1);
 #else
 	ret = (++(*addr));
@@ -1272,7 +1272,7 @@ mg_atomic_dec(volatile int *addr)
 	 * so whatever you use, the other SDK is likely to raise a warning. */
 	ret = InterlockedDecrement((volatile long *)addr);
 #elif defined(__GNUC__)                                                        \
-    && (__GNUC__ > 5 || (__GNUC__ == 4 && __GNUC_MINOR__ > 0))
+    && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 0)))
 	ret = __sync_sub_and_fetch(addr, 1);
 #else
 	ret = (--(*addr));