summaryrefslogtreecommitdiff
path: root/include/my_global.h
diff options
context:
space:
mode:
authorunknown <jimw@rama.(none)>2006-09-28 20:20:33 -0700
committerunknown <jimw@rama.(none)>2006-09-28 20:20:33 -0700
commita34ae64508dc51b5d6e485cdf56217bd69fb948b (patch)
tree20092cfcc9e7be649649de38e18efcb3b577a6c7 /include/my_global.h
parent03c1c20fdd2af85d7899b08321b31754e0df973d (diff)
parent80b4a8e0fe803e79bb2458aefabd0474b7bb0e43 (diff)
downloadmariadb-git-a34ae64508dc51b5d6e485cdf56217bd69fb948b.tar.gz
Merge rama.(none):/home/jimw/my/mysql-5.0-clean
into rama.(none):/home/jimw/my/mysql-5.1-clean include/m_ctype.h: Auto merged include/m_string.h: Auto merged include/my_global.h: Auto merged include/my_sys.h: Auto merged sql/item_subselect.cc: Auto merged sql/item_timefunc.cc: Auto merged sql/opt_range.cc: Auto merged sql/slave.cc: Auto merged sql/sql_acl.cc: Auto merged sql/mysql_priv.h: Resolve conflict sql/mysqld.cc: Resolve conflict sql/set_var.cc: Resolve conflict sql/slave.h: Resolve conflict sql/sql_class.h: Resolve conflict
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 c72a7522127..941594e7855 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -546,15 +546,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.