From aa36d9e74225f6db32fa01a8e1a2a3a6e6a5b77f Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 2 Oct 2014 11:57:40 +0200 Subject: MDEV-5120 Test suite test maria-no-logging fails stat structure (from ) is conditionally defined to have different layout and size depending on the defined macros. The correct macro is defined in my_config.h, which means it MUST be included first (or, at least before - so, practically, before including any system headers). --- config.h.cmake | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'config.h.cmake') diff --git a/config.h.cmake b/config.h.cmake index 3b5501ffd32..4b0769d5cfa 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -641,4 +641,17 @@ #cmakedefine SIZEOF_TIME_T @SIZEOF_TIME_T@ #cmakedefine TIME_T_UNSIGNED @TIME_T_UNSIGNED@ +/* + stat structure (from ) is conditionally defined + to have different layout and size depending on the defined macros. + The correct macro is defined in my_config.h, which means it MUST be + included first (or at least before - so, practically, + before including any system headers). + + __GLIBC__ is defined in +*/ +#ifdef __GLIBC__ +#error MUST be included first! +#endif + #endif -- cgit v1.2.1 From c4598ce30094a084dec7cd4aba157e1a94d488d6 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 10 Nov 2014 19:17:39 +0100 Subject: MDEV-6862 "#error " and third-party libraries only enforce the include order if SAFE_MUTEX is defined (that is, in MariaDB source builds in debug mode) --- config.h.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'config.h.cmake') diff --git a/config.h.cmake b/config.h.cmake index 4b0769d5cfa..34f77dba050 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -648,9 +648,13 @@ included first (or at least before - so, practically, before including any system headers). - __GLIBC__ is defined in + Check the include order by looking at __GLIBC__ (defined in ) + + But we cannot force all third-party clients/connectors to include + my_config.h first. So, their crashes are their responsibility, + we enable this check only for MariaDB sources (SAFE_MUTEX check). */ -#ifdef __GLIBC__ +#if defined(__GLIBC__) && defined(SAFE_MUTEX) #error MUST be included first! #endif -- cgit v1.2.1