summaryrefslogtreecommitdiff
path: root/include/probes_mysql.h
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@montyprogram.com>2012-02-29 18:25:25 +0100
committerVladislav Vaintroub <wlad@montyprogram.com>2012-02-29 18:25:25 +0100
commitc0a4377575c734ce8872d804229f852240d5b661 (patch)
tree26bd839801ea5c0159ddd1ded5b93b33387d0bcc /include/probes_mysql.h
parent4e8bb265fef04c0e331dc78bdfdda6b41e918dfd (diff)
downloadmariadb-git-c0a4377575c734ce8872d804229f852240d5b661.tar.gz
Fix build error on Ubuntu 11.10, if systemtap is installed.
The error is due to conflict between min/max macros in my_global.h and system header < limits>, indirectly included via generated probes_mysql_dtrace.h Temporarily undefined min/max for the inclusion of the probes_mysq_dtrace.h
Diffstat (limited to 'include/probes_mysql.h')
-rw-r--r--include/probes_mysql.h23
1 files changed, 20 insertions, 3 deletions
diff --git a/include/probes_mysql.h b/include/probes_mysql.h
index 191860d0b94..cc47c59b62d 100644
--- a/include/probes_mysql.h
+++ b/include/probes_mysql.h
@@ -18,12 +18,29 @@
#define PROBES_MYSQL_H
-#include <my_global.h>
#if defined(HAVE_DTRACE) && !defined(DISABLE_DTRACE)
+
+#ifdef __linux__
+/*
+ On Linux, generated probes header may include C++ header
+ <limits> which conflicts with min and max macros from my_global.h .
+ To fix, temporarily undefine the macros.
+*/
+#pragma push_macro("min")
+#pragma push_macro("max")
+#undef min
+#undef max
+#endif
+
#include "probes_mysql_dtrace.h"
-#else
-#include "probes_mysql_nodtrace.h"
+
+#ifdef __linux__
+#pragma pop_macro("min")
+#pragma pop_macro("max")
#endif
+#else /* no dtrace */
+#include "probes_mysql_nodtrace.h"
+#endif
#endif /* PROBES_MYSQL_H */