summaryrefslogtreecommitdiff
path: root/include/my_attribute.h
diff options
context:
space:
mode:
authorMichael Widenius <monty@mysql.com>2010-11-30 23:11:03 +0200
committerMichael Widenius <monty@mysql.com>2010-11-30 23:11:03 +0200
commit1e5061fe3be981d6f685a2865fd1e2bcd3fcc23a (patch)
treea0c58838a4dd7bdf2ed4d739563da27727ada7b0 /include/my_attribute.h
parentb2e979d868d5d5964d58c97ed9580e07f6123217 (diff)
parent6f279f40145624c1ffab06c63521f96ce4ac3a02 (diff)
downloadmariadb-git-1e5061fe3be981d6f685a2865fd1e2bcd3fcc23a.tar.gz
merge with 5.1
Diffstat (limited to 'include/my_attribute.h')
-rw-r--r--include/my_attribute.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/include/my_attribute.h b/include/my_attribute.h
index 8309d85f20a..ce14a5298ec 100644
--- a/include/my_attribute.h
+++ b/include/my_attribute.h
@@ -30,10 +30,15 @@
#ifndef __attribute__
# if !defined(__GNUC__)
# define __attribute__(A)
-# elif GCC_VERSION < 2008
-# define __attribute__(A)
-# elif defined(__cplusplus) && GCC_VERSION < 3004
-# define __attribute__(A)
+# else
+# ifndef GCC_VERSION
+# define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
+# endif
+# if GCC_VERSION < 2008
+# define __attribute__(A)
+# elif defined(__cplusplus) && GCC_VERSION < 3004
+# define __attribute__(A)
+# endif
# endif
#endif