diff --git a/BUILDING.md b/BUILDING.md index f915d8564..742d454c7 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -30,11 +30,11 @@ most recent stable version of each tool. by CMake, it may be configured explicitly by setting `CMAKE_ASM_NASM_COMPILER`. - * C and C++ compilers with C++14 support are required. If using a C compiler - other than MSVC, C11 support is also requried. On Windows, MSVC from - Visual Studio 2019 or later with Windows 10 SDK 2104 or later are supported, - but using the latest versions is recommended. Recent versions of GCC (6.1+) - and Clang should work on non-Windows platforms, and maybe on Windows too. + * Compilers for C11 and C++14, or later, are required. On Windows, MSVC from + Visual Studio 2019 or later with Windows 10 SDK 2104 or later are + supported, but using the latest versions is recommended. Recent versions of + GCC (6.1+) and Clang should work on non-Windows platforms, and maybe on + Windows too. * The most recent stable version of [Go](https://golang.org/dl/) is required. Note Go is exempt from the five year support window. If not found by CMake, diff --git a/crypto/internal.h b/crypto/internal.h index a2c49d6c0..4de4597de 100644 --- a/crypto/internal.h +++ b/crypto/internal.h @@ -127,24 +127,13 @@ #endif #if !defined(__cplusplus) -#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L -#include -#elif defined(_MSC_VER) && !defined(__clang__) -#define alignas(x) __declspec(align(x)) -#define alignof __alignof -#else -// With the exception of MSVC, we require C11 to build the library. C11 is a -// prerequisite for improved refcounting performance. All our supported C -// compilers have long implemented C11 and made it default. The most likely -// cause of pre-C11 modes is stale -std=c99 or -std=gnu99 flags in build -// configuration. Such flags can be removed. -// -// TODO(davidben): In MSVC 2019 16.8 or higher (_MSC_VER >= 1928), -// |__STDC_VERSION__| will be 201112 when passed /std:c11 and unset otherwise. -// C11 alignas and alignof are only implemented in C11 mode. Can we mandate C11 -// mode for those versions? +#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L +// BoringSSL requires C11 to build the library. The most likely cause of +// pre-C11 modes is stale -std=c99 or -std=gnu99 flags in build configuration. +// Such flags can be removed. If building with MSVC, build with /std:c11. #error "BoringSSL must be built in C11 mode or higher." #endif +#include #endif #if defined(OPENSSL_THREADS) && \ @@ -160,9 +149,8 @@ // Determine the atomics implementation to use with C. #if !defined(__cplusplus) -#if !defined(OPENSSL_C11_ATOMIC) && defined(OPENSSL_THREADS) && \ - !defined(__STDC_NO_ATOMICS__) && defined(__STDC_VERSION__) && \ - __STDC_VERSION__ >= 201112L +#if !defined(OPENSSL_C11_ATOMIC) && defined(OPENSSL_THREADS) && \ + !defined(__STDC_NO_ATOMICS__) #define OPENSSL_C11_ATOMIC #endif