diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ea6cf3bd..18bbfae4e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,12 +36,20 @@ endif() if (MSVC) - # These are needed for MSVC to play ball as much as possible - # with the /EHs- flag - add_definitions("-D_HAS_EXCEPTIONS=0 -D_STATIC_CPPLIB") - - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /fp:fast /EHs- /GR-") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:fast /EHs- /GR-") + # Disable RTTI + string(FIND "${CMAKE_CXX_FLAGS}" "/GR" MSVC_HAS_GR) + if(MSVC_HAS_GR) + string(REGEX REPLACE "/GR" "/GR-" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + else() + add_compile_options(/GR-) + endif() + + # Disable C++ Exceptions + string(REGEX REPLACE "/EHsc" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + add_compile_options(/D_HAS_EXCEPTIONS=0) + + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /fp:fast") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:fast") if (NOT CLANG) # get the number of logical cores for parallel build diff --git a/libraries/stb/stb_vorbis.h b/libraries/stb/stb_vorbis.h index 40fe6040b..bdc51218a 100644 --- a/libraries/stb/stb_vorbis.h +++ b/libraries/stb/stb_vorbis.h @@ -76,6 +76,14 @@ #ifndef STB_VORBIS_INCLUDE_STB_VORBIS_H #define STB_VORBIS_INCLUDE_STB_VORBIS_H +// EDGE - Disable some finicky warnings from MSVC +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable: 4456) +#pragma warning(disable: 4457) +#pragma warning(disable: 4701) +#endif + #if defined(STB_VORBIS_NO_CRT) && !defined(STB_VORBIS_NO_STDIO) #define STB_VORBIS_NO_STDIO 1 #endif @@ -5652,6 +5660,11 @@ int stb_vorbis_get_samples_float(stb_vorbis *f, int channels, float **buffer, in 0.90 - first public release */ + +#ifdef _MSC_VER +#pragma warning(pop) +#endif + #endif // STB_VORBIS_HEADER_ONLY diff --git a/source_files/edge/f_finale.cc b/source_files/edge/f_finale.cc index fd7b2fbd6..3e505138e 100644 --- a/source_files/edge/f_finale.cc +++ b/source_files/edge/f_finale.cc @@ -302,7 +302,7 @@ void FinaleTicker(void) finale_count = (int)(strlen(finale_text) * finale->text_speed_); skip_finale = false; } - else if (skip_finale || finale_count > finale->text_wait_ + (int)(strlen(finale_text) * finale->text_speed_)) + else if (skip_finale || finale_count > (int) finale->text_wait_ + (int)(strlen(finale_text) * finale->text_speed_)) { DoBumpFinale(); skip_finale = false; diff --git a/source_files/edge/p_action.cc b/source_files/edge/p_action.cc index 836ac3644..7a77b763c 100644 --- a/source_files/edge/p_action.cc +++ b/source_files/edge/p_action.cc @@ -4723,7 +4723,6 @@ void A_SeekTracer(MapObject *mo) int *args = (int *)mo->state_->action_par; - BAMAngle threshold = epi::BAMFromDegrees((float)args[0] / 65536.0f); BAMAngle maxturn = epi::BAMFromDegrees((float)args[1] / 65536.0f); // change angle diff --git a/source_files/edge/w_epk.cc b/source_files/edge/w_epk.cc index 73732f52c..c21e3aeef 100644 --- a/source_files/edge/w_epk.cc +++ b/source_files/edge/w_epk.cc @@ -841,7 +841,7 @@ class VWADFile : public epi::File return 0; // never read more than what GetLength() reports - if (count > length_ - position_) + if (count > (unsigned int) length_ - position_) count = length_ - position_; int got = vwad_read(pack_->vwad_archive_, vwad_file_descriptor_, dest, count);