Commit fd64b185 authored by Alexander Nozdrin's avatar Alexander Nozdrin

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.
parent 2e99b0be
......@@ -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 <zlib.h> // 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 <zlib.h>
C_MODE_START
#include "../mysys/my_static.h" // For soundex_map
C_MODE_END
......
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