From 8c0d01d4266e47ec918698fce4d39eb3a5a4c152 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 14 Nov 2015 11:52:15 +0100 Subject: [PATCH] Fix compile for Intel C++ 15 compiler (nw) --- makefile | 12 +++++ scripts/genie.lua | 6 +-- scripts/src/3rdparty.lua | 84 +++++++++++++++++++++++++++++-- src/devices/cpu/dsp56k/dsp56mem.h | 4 +- src/devices/cpu/i86/i286.cpp | 2 +- 5 files changed, 97 insertions(+), 11 deletions(-) diff --git a/makefile b/makefile index b78ece4d18c..f715cba3ba8 100644 --- a/makefile +++ b/makefile @@ -846,6 +846,18 @@ vs2013_winrt: generate vs2015: generate $(SILENT) $(GENIE) $(PARAMS) vs2015 +vs2015_intel: generate + $(SILENT) $(GENIE) $(PARAMS) --vs=intel-15 vs2015 + +vs2015_xp: generate + $(SILENT) $(GENIE) $(PARAMS) --vs=vs2013-xp vs2015 + +vs2015_clang: generate + $(SILENT) $(GENIE) $(PARAMS) --vs=vs2013-clang vs2015 + +vs2015_winrt: generate + $(SILENT) $(GENIE) $(PARAMS) --vs=winstore81 vs2015 + android-arm: generate ifndef ANDROID_NDK_ARM $(error ANDROID_NDK_ARM is not set) diff --git a/scripts/genie.lua b/scripts/genie.lua index f279dc36041..49742a5e2b3 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -1254,9 +1254,9 @@ if _OPTIONS["vs"]=="intel-15" then "/Qwd1478", -- warning #1478: function "xxx" (declared at line yyy of "zzz") was declared deprecated "/Qwd1879", -- warning #1879: unimplemented pragma ignored "/Qwd3291", -- warning #3291: invalid narrowing conversion from "double" to "int" - "/Qwd1195", - "/Qwd1786", - "/Qwd592", -- For lua, false positive? + "/Qwd1195", -- error #1195: conversion from integer to smaller pointer + "/Qwd47", -- error #47: incompatible redefinition of macro "xxx" + "/Qwd265", -- error #265: floating-point operation result is out of range } end diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua index 664f56cfaac..89e7ea67551 100644 --- a/scripts/src/3rdparty.lua +++ b/scripts/src/3rdparty.lua @@ -16,6 +16,14 @@ project "expat" "/wd4127", -- warning C4127: conditional expression is constant "/wd4244", -- warning C4244: 'argument' : conversion from 'xxx' to 'xxx', possible loss of data } +if _OPTIONS["vs"]=="intel-15" then + buildoptions { + "/Qwd111", -- remark #111: statement is unreachable + "/Qwd1879", -- warning #1879: unimplemented pragma ignored + "/Qwd2557", -- remark #2557: comparison between signed and unsigned operands + "/Qwd869", -- remark #869: parameter "xxx" was never referenced + } +end configuration { "vs2015" } buildoptions { "/wd4456", -- warning C4456: declaration of 'xxx' hides previous local declaration @@ -48,7 +56,12 @@ project "zlib" "/wd4127", -- warning C4127: conditional expression is constant "/wd4244", -- warning C4244: 'argument' : conversion from 'xxx' to 'xxx', possible loss of data } - +if _OPTIONS["vs"]=="intel-15" then + buildoptions { + "/Qwd111", -- remark #111: statement is unreachable + "/Qwd280", -- remark #280: selector expression is constant + } +end configuration "Debug" defines { "verbose=-1", @@ -98,7 +111,11 @@ project "softfloat" includedirs { MAME_DIR .. "src/osd", } - +if _OPTIONS["vs"]=="intel-15" then + buildoptions { + "/Qwd2557", -- remark #2557: comparison between signed and unsigned operands + } +end files { MAME_DIR .. "3rdparty/softfloat/softfloat.c", MAME_DIR .. "3rdparty/softfloat/fsincos.c", @@ -120,6 +137,11 @@ project "jpeg" "/wd4127", -- warning C4127: conditional expression is constant "/wd4244", -- warning C4244: 'argument' : conversion from 'xxx' to 'xxx', possible loss of data } +if _OPTIONS["vs"]=="intel-15" then + buildoptions { + "/Qwd869", -- remark #869: parameter "xxx" was never referenced + } +end configuration { } @@ -193,6 +215,15 @@ project "flac" "/wd4100", -- warning C4100: 'xxx' : unreferenced formal parameter "/wd4702", -- warning C4702: unreachable code } +if _OPTIONS["vs"]=="intel-15" then + buildoptions { + "/Qwd111", -- remark #111: statement is unreachable + "/Qwd177", -- remark #177: function "xxx" was declared but never referenced + "/Qwd181", -- remark #181: argument of type "UINT32={unsigned int}" is incompatible with format "%d", expecting argument of type "int" + "/Qwd188", -- error #188: enumerated type mixed with another type + "/Qwd869", -- remark #869: parameter "xxx" was never referenced + } +end configuration { "vs2015" } buildoptions { @@ -261,6 +292,11 @@ project "7z" buildoptions { "/wd4100", -- warning C4100: 'xxx' : unreferenced formal parameter } +if _OPTIONS["vs"]=="intel-15" then + buildoptions { + "/Qwd869", -- remark #869: parameter "xxx" was never referenced + } +end configuration { "vs2015" } buildoptions { "/wd4456", -- warning C4456: declaration of 'xxx' hides previous local declaration @@ -318,7 +354,11 @@ project "lua" "/wd4702", -- warning C4702: unreachable code "/wd4310", -- warning C4310: cast truncates constant value } - +if _OPTIONS["vs"]=="intel-15" then + buildoptions { + "/Qwd592", -- error #592: variable "xxx" is used before its value is set + } +end configuration { } defines { "LUA_COMPAT_ALL", @@ -459,6 +499,12 @@ project "sqllite3" "/wd4100", -- warning C4100: 'xxx' : unreferenced formal parameter "/wd4706", -- warning C4706: assignment within conditional expression } +if _OPTIONS["vs"]=="intel-15" then + buildoptions { + "/Qwd869", -- remark #869: parameter "xxx" was never referenced + "/Qwd2557", -- remark #2557: comparison between signed and unsigned operands + } +end configuration { "vs2015" } buildoptions { @@ -513,6 +559,14 @@ project "portmidi" "/wd4244", -- warning C4244: 'argument' : conversion from 'xxx' to 'xxx', possible loss of data "/wd4706", -- warning C4706: assignment within conditional expression } +if _OPTIONS["vs"]=="intel-15" then + buildoptions { + "/Qwd188", -- error #188: enumerated type mixed with another type + "/Qwd344", -- remark #344: typedef name has already been declared (with same type) + "/Qwd869", -- remark #869: parameter "xxx" was never referenced + "/Qwd2557", -- remark #2557: comparison between signed and unsigned operands + } +end configuration { "vs2015" } buildoptions { @@ -587,7 +641,13 @@ project "bgfx" "/wd4611", -- warning C4611: interaction between '_setjmp' and C++ object destruction is non-portable "/wd4310", -- warning C4310: cast truncates constant value } - +if _OPTIONS["vs"]=="intel-15" then + buildoptions { + "/Qwd906", -- message #906: effect of this "#pragma pack" directive is local to function "xxx" + "/Qwd1879", -- warning #1879: unimplemented pragma ignored + "/Qwd82", -- remark #82: storage class is not first + } +end configuration { } includedirs { @@ -706,7 +766,14 @@ project "portaudio" "/wd4189", -- warning C4189: 'xxx' : local variable is initialized but not referenced "/wd4127", -- warning C4127: conditional expression is constant } - +if _OPTIONS["vs"]=="intel-15" then + buildoptions { + "/Qwd869", -- remark #869: parameter "xxx" was never referenced + "/Qwd1478", -- warning #1478: function "xxx" (declared at line yyy of "zzz") was declared deprecated + "/Qwd2544", -- message #2544: empty dependent statement in if-statement + "/Qwd1879", -- warning #1879: unimplemented pragma ignored + } +end configuration { "vs2015" } buildoptions { "/wd4456", -- warning C4456: declaration of 'xxx' hides previous local declaration @@ -848,6 +915,13 @@ project "gtest" "-Wno-unused-variable", } + configuration { "vs*" } +if _OPTIONS["vs"]=="intel-15" then + buildoptions { + "/Qwd1195", -- error #1195: conversion from integer to smaller pointer + } +end + configuration { } includedirs { diff --git a/src/devices/cpu/dsp56k/dsp56mem.h b/src/devices/cpu/dsp56k/dsp56mem.h index 93ab74ede42..e8445f1b736 100644 --- a/src/devices/cpu/dsp56k/dsp56mem.h +++ b/src/devices/cpu/dsp56k/dsp56mem.h @@ -13,10 +13,10 @@ namespace DSP56K void mem_reset(dsp56k_core* cpustate); // Adjusts the documented address to match the offset in peripheral RAM -#define A2O(a) (a-0xffc0) +#define A2O(a) (a - 0xffc0) // Adjusts the offset in peripheral RAM to match the documented address -#define O2A(a) (a+0xffc0) +#define O2A(a) (a + 0xffc0) // The memory 'registers' #define PBC (cpustate->peripheral_ram[A2O(0xffc0)]) diff --git a/src/devices/cpu/i86/i286.cpp b/src/devices/cpu/i86/i286.cpp index e6314b9cf83..637f9cc1e47 100644 --- a/src/devices/cpu/i86/i286.cpp +++ b/src/devices/cpu/i86/i286.cpp @@ -1292,7 +1292,7 @@ m_limit[sreg] = LIMIT(desc); } LOADDESC(0x848, DS); #undef LOADDESC // void cast supresses warning -#define LOADDESC(addr, reg, r) { desc[1] = read_word(addr); desc[2] = read_word(addr+2); desc[0] = read_word(addr+4); \ +#define LOADDESC(addr, reg, r) { desc[1] = read_word(addr); desc[2] = read_word(addr + 2); desc[0] = read_word(addr + 4); \ reg.base = BASE(desc); (void)(r); reg.limit = LIMIT(desc); } LOADDESC(0x84e, m_gdtr, 1); LOADDESC(0x854, m_ldtr, m_ldtr.rights = RIGHTS(desc));