Commit 329daad2 authored by Sergei Golubchik's avatar Sergei Golubchik

more portable fix for lp:942266 - 5.5 builds fail with systemtap-sdt-dev installed on Ubuntu

include <limits> early, before min/max macros are defined.
parent 1185420d
......@@ -1429,6 +1429,10 @@ static inline char *dlerror(void)
/* Length of decimal number represented by INT64. */
#define MY_INT64_NUM_DECIMAL_DIGITS 21
#ifdef __cplusplus
#include <limits> /* should be included before min/max macros */
#endif
/* Define some useful general macros (should be done after all headers). */
#if !defined(max)
#define max(a, b) ((a) > (b) ? (a) : (b))
......
......@@ -18,28 +18,8 @@
#define PROBES_MYSQL_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"
#ifdef __linux__
#pragma pop_macro("min")
#pragma pop_macro("max")
#endif
#else /* no dtrace */
#include "probes_mysql_nodtrace.h"
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment