Fix definition GCC_VERSION

Change-Id: I4699bd52939d9f5c138f1e6232425babc40060c5
diff --git a/src/common_test.h b/src/common_test.h
index 7da730f..14adfbe 100644
--- a/src/common_test.h
+++ b/src/common_test.h
@@ -16,6 +16,7 @@
 #include "file.h"
 #include "gtest/gtest.h"
 #include "heap.h"
+#include "macros.h"
 #include "oat_file.h"
 #include "object_utils.h"
 #include "os.h"
@@ -177,17 +178,18 @@
     uintptr_t limit = RoundUp(data + code_length, kPageSize);
     uintptr_t len = limit - base;
     int result = mprotect(reinterpret_cast<void*>(base), len, PROT_READ | PROT_WRITE | PROT_EXEC);
+    CHECK_EQ(result, 0);
 
     // Flush instruction cache
     // Only uses __builtin___clear_cache if GCC >= 4.3.3
 #if GCC_VERSION >= 40303
     __builtin___clear_cache(reinterpret_cast<void*>(base), reinterpret_cast<void*>(base + len));
-#else
+#elif defined(__APPLE__)
     // Currently, only Mac OS builds use GCC 4.2.*. Those host builds do not
     // need to generate clear_cache on x86.
+#else
+#error unsupported
 #endif
-
-    CHECK_EQ(result, 0);
   }
 
  protected:
diff --git a/src/macros.h b/src/macros.h
index fc65564..6f961fa 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -16,7 +16,7 @@
 
 #include <stddef.h>  // for size_t
 
-#define GCC_VERSION (_GNUC_ * 10000 + _GNUC_MINOR_ * 100 + __GNUC_PATCHLEVEL__)
+#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
 
 // The COMPILE_ASSERT macro can be used to verify that a compile time
 // expression is true. For example, you could use it to verify the