summaryrefslogtreecommitdiff
path: root/include/my_global.h
diff options
context:
space:
mode:
authorunknown <jimw@rama.(none)>2006-09-29 19:28:16 -0700
committerunknown <jimw@rama.(none)>2006-09-29 19:28:16 -0700
commit89fa50a92ba72ef54a4dec451be674863780c608 (patch)
tree9c907d127acd58dacd2ca6925a1cd19011c0b875 /include/my_global.h
parent09a9e9a27581a941b4c6c95cfea1d1122e60b463 (diff)
downloadmariadb-git-89fa50a92ba72ef54a4dec451be674863780c608.tar.gz
Disable __attribute__ entirely on g++ < 3.4. (Bug #2717)
include/my_global.h: Disable __attribute__ on g++ < 3.4. There are actually some forms of it that are supported, but rather than create more ATTRIBUTE_<foo> macros to handle them, it is easier to just disable them all. We will catch the compiler warnings with more recent versions of g++.
Diffstat (limited to 'include/my_global.h')
-rw-r--r--include/my_global.h25
1 files changed, 15 insertions, 10 deletions
diff --git a/include/my_global.h b/include/my_global.h
index 2fbb1db4b77..173f054b306 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -423,23 +423,28 @@ typedef unsigned short ushort;
#endif
/*
- Disable __attribute__() on GCC < 2.7 and non-GCC compilers
+ Disable __attribute__() on gcc < 2.7, g++ < 3.4, and non-gcc compilers.
+ Some forms of __attribute__ are actually supported in earlier versions of
+ g++, but we just disable them all because we only use them to generate
+ compilation warnings.
*/
-#if !defined(__attribute__) && (!defined(__GNUC__) || GCC_VERSION < 2007)
-#define __attribute__(A)
+#ifndef __attribute__
+# if !defined(__GNUC__)
+# define __attribute__(A)
+# elif GCC_VERSION < 2008
+# define __attribute__(A)
+# elif defined(__cplusplus__) && GCC_VERSION < 3004
+# define __attribute__(A)
+# endif
#endif
/*
__attribute__((format(...))) is only supported in gcc >= 2.8 and g++ >= 3.4
+ But that's already covered by the __attribute__ tests above, so this is
+ just a convenience macro.
*/
#ifndef ATTRIBUTE_FORMAT
-# if defined(__GNUC__) && \
- ((!defined(__cplusplus__) && GCC_VERSION >= 2008) || \
- GCC_VERSION >= 3004)
-# define ATTRIBUTE_FORMAT(style, m, n) __attribute__((format(style, m, n)))
-# else
-# define ATTRIBUTE_FORMAT(style, m, n)
-# endif
+# define ATTRIBUTE_FORMAT(style, m, n) __attribute__((format(style, m, n)))
#endif
/* From old s-system.h */