diff -up mariadb-5.5.40/config.h.cmake.rev4355 mariadb-5.5.40/config.h.cmake --- mariadb-5.5.40/config.h.cmake.rev4355 2014-10-08 15:19:51.000000000 +0200 +++ mariadb-5.5.40/config.h.cmake 2014-12-15 13:34:52.874221087 +0100 @@ -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