small tweaks and fixes for compiling with MSVC++

This commit is contained in:
Axel Kohlmeyer
2021-10-06 15:24:59 -04:00
parent ec1a55b35b
commit 6c7b42a190
2 changed files with 5 additions and 3 deletions

View File

@ -97,9 +97,11 @@ if(PKG_KOKKOS AND (CMAKE_CXX_STANDARD LESS 14))
endif() endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF CACHE BOOL "Use compiler extensions") set(CMAKE_CXX_EXTENSIONS OFF CACHE BOOL "Use compiler extensions")
# ugly hack for MSVC which by default always reports an old C++ standard in the __cplusplus macro # ugly hacks for MSVC which by default always reports an old C++ standard in the __cplusplus macro
# and prints lots of pointless warnings about "unsafe" functions
if(MSVC) if(MSVC)
add_compile_options(/Zc:__cplusplus) add_compile_options(/Zc:__cplusplus)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
endif() endif()
# export all symbols when building a .dll file on windows # export all symbols when building a .dll file on windows

View File

@ -196,7 +196,7 @@ Dump::~Dump()
if (multifile == 0 && fp != nullptr) { if (multifile == 0 && fp != nullptr) {
if (compressed) { if (compressed) {
if (filewriter) pclose(fp); if (filewriter) platform::pclose(fp);
} else { } else {
if (filewriter) fclose(fp); if (filewriter) fclose(fp);
} }
@ -518,7 +518,7 @@ void Dump::write()
if (multifile) { if (multifile) {
if (compressed) { if (compressed) {
if (filewriter && fp != nullptr) pclose(fp); if (filewriter && fp != nullptr) platform::pclose(fp);
} else { } else {
if (filewriter && fp != nullptr) fclose(fp); if (filewriter && fp != nullptr) fclose(fp);
} }