From 0dd6764d7b7c5486763884a6882bafb428c5f1f9 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 26 Dec 2022 15:24:20 +0000 Subject: [PATCH] Windows build: Fix AppVeyor build --- CMakeLists.txt | 3 --- src/grib_api_internal.h | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8fbbba56d..724c9130d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -339,13 +339,10 @@ if( EC_OS_NAME MATCHES "windows" ) # Suppress warnings about using 'insecure' functions. Fixing this would require changes all over # the codebase which would damage portability. ecbuild_add_c_flags("/D_CRT_SECURE_NO_WARNINGS") - ecbuild_add_cxx_flags("/D_CRT_SECURE_NO_WARNINGS") # Suppress warnings about using well-known C functions. ecbuild_add_c_flags("/D_CRT_NONSTDC_NO_DEPRECATE") - ecbuild_add_cxx_flags("/D_CRT_NONSTDC_NO_DEPRECATE") # Suppress C4267: warns about possible loss of data when converting 'size_t' to 'int'. ecbuild_add_c_flags("/wd4267") - ecbuild_add_cxx_flags("/wd4267") endif() ############################################################################### diff --git a/src/grib_api_internal.h b/src/grib_api_internal.h index 2492aa9a8..553a44374 100644 --- a/src/grib_api_internal.h +++ b/src/grib_api_internal.h @@ -96,6 +96,8 @@ extern "C" { #define mkdir(dirname, mode) _mkdir(dirname) #ifdef _MSC_VER + #define _CRT_SECURE_NO_WARNINGS + #define _CRT_NONSTDC_NO_DEPRECATE #define access(path, mode) _access(path, mode) #define chmod(path, mode) _chmod(path, mode) #define strdup(str) _strdup(str)