summaryrefslogtreecommitdiff
path: root/include/my_global.h
diff options
context:
space:
mode:
authorjimw@rama.(none) <>2006-09-28 18:09:10 -0700
committerjimw@rama.(none) <>2006-09-28 18:09:10 -0700
commit68eadc8a793923c95d2a4a07a689d050b79f61f4 (patch)
treef325a06780e46cb928226f1db47f7a001930ff47 /include/my_global.h
parent9c3012e646420c2760daf541f7aaefb13c7d3e1e (diff)
parentcb6a084076d4688c11936bfa91b03a83570f69e0 (diff)
downloadmariadb-git-68eadc8a793923c95d2a4a07a689d050b79f61f4.tar.gz
Merge rama.(none):/home/jimw/my/mysql-4.1-clean
into rama.(none):/home/jimw/my/mysql-5.0-clean
Diffstat (limited to 'include/my_global.h')
-rw-r--r--include/my_global.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/include/my_global.h b/include/my_global.h
index 4a9e1673de4..6363b5ac8d3 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -454,15 +454,35 @@ typedef unsigned short ushort;
#define function_volatile volatile
#define my_reinterpret_cast(A) reinterpret_cast<A>
#define my_const_cast(A) const_cast<A>
+# ifndef GCC_VERSION
+# define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
+# endif
#elif !defined(my_reinterpret_cast)
#define my_reinterpret_cast(A) (A)
#define my_const_cast(A) (A)
#endif
-#if !defined(__attribute__) && (defined(__cplusplus) || !defined(__GNUC__) || __GNUC__ == 2 && __GNUC_MINOR__ < 8)
+
+/*
+ Disable __attribute__() on GCC < 2.7 and non-GCC compilers
+*/
+#if !defined(__attribute__) && (!defined(__GNUC__) || GCC_VERSION < 2007)
#define __attribute__(A)
#endif
/*
+ __attribute__((format(...))) is only supported in gcc >= 2.8 and g++ >= 3.4
+*/
+#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
+#endif
+
+/*
Wen using the embedded library, users might run into link problems,
duplicate declaration of __cxa_pure_virtual, solved by declaring it a
weak symbol.