summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author peterferrie <peter.ferrie@gmail.com>2015-02-03 23:03:32 -0800
committer peterferrie <peter.ferrie@gmail.com>2015-02-03 23:03:32 -0800
commitaa0ffdc153eafc0a0a0f0ddd654fce11c1f83f13 (patch)
tree764a3ee863158f3835454e6b389b68ad14839bf5
parentca1434d52f6ddf3ff6755dbe52fd477ae03ea243 (diff)
fix compile on MSVC 2012 (nw)
-rw-r--r--src/lib/lib.mak2
-rw-r--r--src/osd/windows/vconv.c6
-rw-r--r--src/osd/windows/winprefix.h14
3 files changed, 14 insertions, 8 deletions
diff --git a/src/lib/lib.mak b/src/lib/lib.mak
index 2b6d5215601..c9550c18ca6 100644
--- a/src/lib/lib.mak
+++ b/src/lib/lib.mak
@@ -646,7 +646,7 @@ $(OBJ)/libbgfx.a: $(BGFXOBJS)
BGFXINC = -I$(3RDPARTY)/bgfx/include -I$(3RDPARTY)/bgfx/3rdparty -I$(3RDPARTY)/bx/include -I$(3RDPARTY)/bgfx/3rdparty/khronos
ifdef MSVC_BUILD
- BGFXINC += -I$(3RDPARTY)/bx/include/compat/msvc
+ BGFXINC += -I$(3RDPARTY)/bx/include/compat/msvc /EHsc
else
ifeq ($(TARGETOS),win32)
BGFXINC += -I$(3RDPARTY)/bx/include/compat/mingw
diff --git a/src/osd/windows/vconv.c b/src/osd/windows/vconv.c
index 05041037400..814ab742067 100644
--- a/src/osd/windows/vconv.c
+++ b/src/osd/windows/vconv.c
@@ -78,12 +78,14 @@ static const translation_info gcc_translate[] =
// warning C4146: unary minus operator applied to unsigned type, result still unsigned
// warning C4150: deletion of pointer to incomplete type 'xxx'; no destructor called
// warning C4189: 'xxx' : local variable is initialized but not referenced
+ // warning C4191: 'type cast' : unsafe conversion from 'xxx' to 'xxx' // 64-bit only
// warning C4201: nonstandard extension used : nameless struct/union
// warning C4242: 'x' : conversion from 'xxx' to 'xxx', possible loss of data
// warning C4244: 'argument' : conversion from 'xxx' to 'xxx', possible loss of data
// warning C4250: 'xxx' : inherits 'xxx' via dominance
// warning C4255: 'xxx' : no function prototype given: converting '()' to '(void)'
// warning C4296: 'x' : expression is always false
+ // warning C4306: 'xxx': conversion from 'type1' to 'type2' of greater size // 64-bit only
// warning C4310: cast truncates constant value
// warning C4324: 'xxx' : structure was padded due to __declspec(align())
// warning C4347: behavior change: 'xxx' is called instead of 'xxx' // obsolete VS2005 - VS2010 only
@@ -91,11 +93,13 @@ static const translation_info gcc_translate[] =
// warning C4510: 'xxx' : default constructor could not be generated
// warning C4512: 'xxx' : assignment operator could not be generated
// warning C4514: 'xxx' : unreferenced inline function has been removed
+ // warning C4611: interaction between '_setjmp' and C++ object destruction is non-portable
// warning C4619: #pragma warning : there is no warning number 'xxx'
// warning C4571: Informational: catch(...) semantics changed since Visual C++ 7.1; structured exceptions (SEH) are no longer caught
// warning C4610: struct 'xxx' can never be instantiated - user defined constructor required
// warning C4625: 'xxx' : copy constructor could not be generated because a base class copy constructor is inaccessible or deleted
// warning C4626: 'xxx' : assignment operator could not be generated because a base class assignment operator is inaccessible or deleted
+ // warning C4640: 'xxx' : construction of local static object is not thread-safe
// warning C4668: 'xxx' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
// warning C4702: unreachable code
// warning C4706: assignment within conditional expression
@@ -104,7 +108,7 @@ static const translation_info gcc_translate[] =
// warning C4805: 'x' : unsafe mix of type 'xxx' and type 'xxx' in operation
// warning C4820: 'xxx' : 'x' bytes padding added after data member 'xxx'
// warning C4826: Conversion from 'type1 ' to 'type_2' is sign-extended. This may cause unexpected runtime behavior. // 32-bit only
- { VS7, "-Wall", "/Wall /W4 /wd4003 /wd4018 /wd4061 /wd4100 /wd4127 /wd4131 /wd4141 /wd4146 /wd4150 /wd4189 /wd4201 /wd4242 /wd4244 /wd4250 /wd4255 /wd4296 /wd4310 /wd4324 /wd4347 /wd4435 /wd4510 /wd4512 /wd4514 /wd4571 /wd4610 /wd4619 /wd4625 /wd4626 /wd4668 /wd4702 /wd4706 /wd4710 /wd4711 /wd4805 /wd4820 /wd4826" },
+ { VS7, "-Wall", "/Wall /W4 /wd4003 /wd4018 /wd4061 /wd4100 /wd4127 /wd4131 /wd4141 /wd4146 /wd4150 /wd4189 /wd4191 /wd4201 /wd4242 /wd4244 /wd4250 /wd4255 /wd4296 /wd4306 /wd4310 /wd4324 /wd4347 /wd4435 /wd4510 /wd4512 /wd4514 /wd4571 /wd4610 /wd4611 /wd4619 /wd4625 /wd4626 /wd4640 /wd4668 /wd4702 /wd4706 /wd4710 /wd4711 /wd4805 /wd4820 /wd4826" },
{ 0, "-Wall", "/W0" },
{ VS7, "-Wno-unused", "/wd4100 /wd4101 /wd4102 /wd4505" },
{ 0, "-Wno-sign-compare", "/wd4365 /wd4389 /wd4245 /wd4388" },
diff --git a/src/osd/windows/winprefix.h b/src/osd/windows/winprefix.h
index 411e327a9d4..53f03e46a1f 100644
--- a/src/osd/windows/winprefix.h
+++ b/src/osd/windows/winprefix.h
@@ -13,9 +13,9 @@
#ifdef _MSC_VER
#include <assert.h>
#include <malloc.h>
-#if _MSC_VER < 1500 // < VS2008
-#define vsnprintf _vsnprintf
-#elif _MSC_VER < 1800 // < VS2013
+#if _MSC_VER < 1900 // < VS2015
+#define snprintf _snprintf
+#if _MSC_VER < 1800 // VS2013 or earlier
#define alloca _alloca
#define round(x) floor((x) + 0.5)
#define strtoll _strtoi64
@@ -24,9 +24,11 @@
static __inline double fmin(double x, double y){ return (x < y) ? x : y; }
static __inline double fmax(double x, double y){ return (x > y) ? x : y; }
static __inline double log2(double x) { return log(x) * M_LOG2E; }
-#elif _MSC_VER < 1900 // < VS2015
-#define snprintf _snprintf
-#else
+#if _MSC_VER < 1500 // VS2008 or earlier
+#define vsnprintf _vsnprintf
+#endif // VS2008
+#endif // VS2013
+#else // VS2015
#pragma warning (disable: 4091)
#pragma warning (disable: 4267)
#pragma warning (disable: 4456 4457 4458 4459)