diff --git a/CMakeLists.txt b/CMakeLists.txt index 8341f6b6..5954ac87 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,8 @@ endfunction() if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") add_compile_options(-Wall -Wextra -pedantic -Wcast-qual -Wfloat-equal -Wmissing-declarations -Wmissing-format-attribute -Wredundant-decls -Wshadow -Wundef -Wold-style-cast -Wno-multichar) +elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC") + add_compile_definitions(_CRT_SECURE_NO_WARNINGS) elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") add_compile_options(-Weverything) # no need for c++98 compatibility diff --git a/simplecpp.h b/simplecpp.h index 5b918a98..1857908d 100755 --- a/simplecpp.h +++ b/simplecpp.h @@ -44,6 +44,12 @@ #define nullptr NULL #endif +#if defined(_MSC_VER) +// suppress warnings about "conversion from 'type1' to 'type2', possible loss of data" +# pragma warning(disable : 4267) +# pragma warning(disable : 4244) +#endif + namespace simplecpp { typedef std::string TokenString;