summaryrefslogtreecommitdiff
path: root/include/my_global.h
diff options
context:
space:
mode:
authorunknown <jimw@rama.(none)>2006-09-28 18:09:10 -0700
committerunknown <jimw@rama.(none)>2006-09-28 18:09:10 -0700
commit44cdd695ab62ce115f1376cc63ee1c46e6f3b4b3 (patch)
treef325a06780e46cb928226f1db47f7a001930ff47 /include/my_global.h
parenta59f477cde80dc1fbd354c1a0f7a7c722833822f (diff)
parent915bdfbea873dd064edc28905945f2f098bb83e2 (diff)
downloadmariadb-git-44cdd695ab62ce115f1376cc63ee1c46e6f3b4b3.tar.gz
Merge rama.(none):/home/jimw/my/mysql-4.1-clean
into rama.(none):/home/jimw/my/mysql-5.0-clean include/m_ctype.h: Auto merged include/m_string.h: Auto merged include/my_global.h: Auto merged sql/item_subselect.cc: Auto merged sql/item_timefunc.cc: Auto merged sql/set_var.cc: Auto merged sql/slave.cc: Auto merged sql/slave.h: Auto merged sql/sql_class.h: Auto merged include/my_sys.h: Resolve conflict sql/mysql_priv.h: Resolve conflict sql/mysqld.cc: Resolve conflict sql/opt_range.cc: Resolve conflict sql/sql_acl.cc: 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 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.