From fd64b18545d8e6dd9f4493162df068d174ffb24c Mon Sep 17 00:00:00 2001 From: Alexander Nozdrin Date: Wed, 21 Apr 2010 23:58:54 +0400 Subject: Patch for Bug#53022: Compilation of "embedded" is broken. The bug was a side effect of WL#5030 (fix header files) and WL#5161 (CMake). The problem was that CMake-generated config.h (and my_config.h as a copy of it) had a header guard. GNU autotools-generated [my_]config.h did not. During WL#5030 the order of header files was changed, so the following started to happen (using GNU autotools, in embedded server): - my_config.h included, defining HAVE_OPENSSL - my_global.h included, un-defining HAVE_OPENSSL - zlib.h included, including config.h, defining HAVE_OPENSSL again. The fix is to change the order of header file, moving zlib.h to the top of the header list. More proper fix would be to wrap unguarded auto-generated [my_]config.h by guarded non-generated header file. --- sql/item_strfunc.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'sql') diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 32baae87c50..7025cf1af56 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -29,6 +29,13 @@ #pragma implementation // gcc: Class implementation #endif +/* + NOTE: zlib.h must be included *before* my_global.h because my_global.h + may undef some HAVE_ macros. Including zlib.h after my_global.h may lead + to re-defining undefined macros, thus to compile errors. +*/ +#include // Must be before my_global.h + /* May include caustic 3rd-party defs. Use early, so it can override nothing. */ #include "sha2.h" #include "my_global.h" // HAVE_* @@ -51,7 +58,6 @@ #include "my_md5.h" #include "sha1.h" #include "my_aes.h" -#include C_MODE_START #include "../mysys/my_static.h" // For soundex_map C_MODE_END -- cgit v1.2.1