From df865c349a37328a6bdc516aef04defcc75841bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?okhowang=28=E7=8E=8B=E6=B2=9B=E6=96=87=29?= Date: Thu, 3 Sep 2020 16:21:30 +0800 Subject: [PATCH] Pass c99 to compiler in CMakeLists.txt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #3631 Signed-off-by: okhowang(王沛文) --- 3rdparty/everest/library/Hacl_Curve25519_joined.c | 6 ++++++ CMakeLists.txt | 2 ++ 2 files changed, 8 insertions(+) diff --git a/3rdparty/everest/library/Hacl_Curve25519_joined.c b/3rdparty/everest/library/Hacl_Curve25519_joined.c index ee62be1ceb..49d4b4882f 100644 --- a/3rdparty/everest/library/Hacl_Curve25519_joined.c +++ b/3rdparty/everest/library/Hacl_Curve25519_joined.c @@ -18,6 +18,12 @@ * * This file is part of mbed TLS (https://tls.mbed.org) */ +#ifndef _BSD_SOURCE +#define _BSD_SOURCE +#endif +#ifndef _DEFAULT_SOURCE +#define _DEFAULT_SOURCE +#endif #include "common.h" diff --git a/CMakeLists.txt b/CMakeLists.txt index 0fccd3d1bd..ec140245f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -170,6 +170,8 @@ string(REGEX MATCH "Clang" CMAKE_COMPILER_IS_CLANG "${CMAKE_C_COMPILER_ID}") include(CheckCCompilerFlag) +set(CMAKE_C_STANDARD 99) + if(CMAKE_COMPILER_IS_GNU) # some warnings we want are not available with old GCC versions # note: starting with CMake 2.8 we could use CMAKE_C_COMPILER_VERSION