From 4cbbb64e21c4bc1e9f7c07a13f7a71db775c0e18 Mon Sep 17 00:00:00 2001 From: Leo Yuriev Date: Mon, 6 Jun 2016 01:40:41 +0300 Subject: [PATCH] mdbx: ban the compilers older than GCC 4.2 or incompatible with it. Change-Id: I30cfc04b086116652b3c40d76e1def8428b0dcd7 --- Makefile | 1 + reopen.h | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 0235df50..90adc7b7 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ # GNU Makefile for libmdbx (reliable lightning memory-mapped DB library for Linux). +# https://github.com/ReOpen/libmdbx ######################################################################## # Configuration. The compiler options must enable threaded compilation. diff --git a/reopen.h b/reopen.h index 733886f9..313eb0a5 100644 --- a/reopen.h +++ b/reopen.h @@ -21,7 +21,16 @@ /* LY: Please do not ask us for Windows support, just never! * But you can make a fork for Windows, or become maintainer for FreeBSD... */ #ifndef __gnu_linux__ -# error "ReOpenLDAP branch supports only GNU Linux" +# error "MDBX supports only GNU Linux" +#endif + +#if !defined(__GNUC__) || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2) + /* LY: Actualy MDBX was not tested with compilers + * older than GCC 4.4 from RHEL6, and clang 3.6 from Ubuntu. + * But you could remove this #error and try to continue at your own risk. + * In such case please don't rise up an issues related ONLY to old compilers. + */ +# error "MDBX required at least GCC 4.2 compatible C/C++ compiler." #endif #ifndef _REOPEN_H @@ -31,14 +40,14 @@ # define _GNU_SOURCE #endif +#if !defined(GCC_VERSION) && defined(__GNUC__) +# define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) +#endif /* GCC_VERSION */ + #ifndef __has_attribute # define __has_attribute(x) (0) #endif -#if !defined(GCC_VERSION) && defined(__GNUC__) -# define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__) -#endif /* GCC_VERSION */ - #if !defined(__thread) && (defined(_MSC_VER) || defined(__DMC__)) # define __thread __declspec(thread) #endif