From d49032ef73210942a442b3f1109258178f38fafe Mon Sep 17 00:00:00 2001 From: Michael Casadevall Date: Tue, 28 Jun 2016 08:34:11 -0500 Subject: [PATCH] Supress a lot of compiler noise in hopes of finding real errors. Right now, a plugin free DFHack can be built with VS2015 --- CMakeLists.txt | 9 +++++++++ library/include/Error.h | 14 ++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c71cb8c94..ffc379724 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,6 +56,15 @@ endif() if(MSVC) # disable C4819 code-page warning add_definitions( "/wd4819" ) + +# Disable use of POSIX name warnings +add_definitions ( "/D_CRT_NONSTDC_NO_WARNINGS") + +# supress C4503 - VC++ dislikes if a name is too long. If you get +# weird and mysterious linking errors, you can disable this, but you'll have to +# deal with a LOT of compiler noise over it +# see https://msdn.microsoft.com/en-us/library/074af4b6.aspx +add_definitions( "/wd4503") endif() IF(CMAKE_CROSSCOMPILING) diff --git a/library/include/Error.h b/library/include/Error.h index 4e3ff269c..4e3224f49 100644 --- a/library/include/Error.h +++ b/library/include/Error.h @@ -38,8 +38,18 @@ namespace DFHack * our wrapper for the C++ exception. used to differentiate * the whole array of DFHack exceptions from the rest */ - class DFHACK_EXPORT All : public std::exception{}; - +#ifdef _MSC_VER +#pragma push +/** + * C4275 is - The warning officially is non dll-interface class 'std::exception' used as base for + * dll-interface class + * + * Basically, its saying that you might have an ABI problem if you mismatch compilers. We don't + * care since we build all of DFhack at once against whatever Toady is using + */ +#pragma warning(disable: 4275) + class DFHACK_EXPORT All : public std::exception{}; +#endif class DFHACK_EXPORT NullPointer : public All { const char *varname_; public: