diff options
Diffstat (limited to 'config.h.cmake')
-rw-r--r-- | config.h.cmake | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/config.h.cmake b/config.h.cmake index 1c8e22a20e9..eadedb41c01 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -661,4 +661,21 @@ #define __STDC_FORMAT_MACROS #endif +/* + stat structure (from <sys/stat.h>) 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 <features.h> - so, practically, + before including any system headers). + + Check the include order by looking at __GLIBC__ (defined in <features.h>) + + 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). +*/ +#if defined(__GLIBC__) && defined(SAFE_MUTEX) +#error <my_config.h> MUST be included first! +#endif + #endif |