mirror of
https://github.com/MariaDB/server.git
synced 2025-01-15 19:42:28 +01:00
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.
This commit is contained in:
parent
1185420da0
commit
329daad2d3
2 changed files with 4 additions and 20 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue