summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar Vas Crabb <vas@vastheman.com>2020-08-11 16:57:47 +1000
committerGravatarGravatar Vas Crabb <vas@vastheman.com>2020-08-11 16:57:47 +1000
commit2a342ec7c9843debc6e8bf6955a94c09a6bf495f (patch)
tree728a6b2faea5ead05e80dadf59826b3d44997516
parent461b8338a25167fc6641faab7566d6ca18610156 (diff)
cpu/nec: use anonymous namespaces to avoid ODR violations with enums
-rw-r--r--scripts/src/cpu.lua4
-rw-r--r--src/devices/cpu/nec/nec.cpp3
-rw-r--r--src/devices/cpu/nec/necpriv.ipp (renamed from src/devices/cpu/nec/necpriv.h)5
-rw-r--r--src/devices/cpu/nec/v25.cpp8
-rw-r--r--src/devices/cpu/nec/v25priv.ipp (renamed from src/devices/cpu/nec/v25priv.h)5
-rw-r--r--src/devices/cpu/nec/v25sfr.cpp2
-rw-r--r--src/devices/cpu/nec/v5x.cpp2
7 files changed, 21 insertions, 8 deletions
diff --git a/scripts/src/cpu.lua b/scripts/src/cpu.lua
index e2ed4badf4a..64814fd67d7 100644
--- a/scripts/src/cpu.lua
+++ b/scripts/src/cpu.lua
@@ -1883,10 +1883,10 @@ if (CPUS["NEC"]~=null) then
MAME_DIR .. "src/devices/cpu/nec/nec80inst.hxx",
MAME_DIR .. "src/devices/cpu/nec/necmacro.h",
MAME_DIR .. "src/devices/cpu/nec/necmodrm.h",
- MAME_DIR .. "src/devices/cpu/nec/necpriv.h",
+ MAME_DIR .. "src/devices/cpu/nec/necpriv.ipp",
MAME_DIR .. "src/devices/cpu/nec/v25instr.h",
MAME_DIR .. "src/devices/cpu/nec/v25instr.hxx",
- MAME_DIR .. "src/devices/cpu/nec/v25priv.h",
+ MAME_DIR .. "src/devices/cpu/nec/v25priv.ipp",
MAME_DIR .. "src/devices/cpu/nec/v25.cpp",
MAME_DIR .. "src/devices/cpu/nec/v25.h",
MAME_DIR .. "src/devices/cpu/nec/v25sfr.cpp",
diff --git a/src/devices/cpu/nec/nec.cpp b/src/devices/cpu/nec/nec.cpp
index 2a9546977c2..b46910bc4d9 100644
--- a/src/devices/cpu/nec/nec.cpp
+++ b/src/devices/cpu/nec/nec.cpp
@@ -107,6 +107,7 @@
#include "emu.h"
#include "nec.h"
#include "necdasm.h"
+
#include "debugger.h"
typedef uint8_t BOOLEAN;
@@ -114,7 +115,7 @@ typedef uint8_t BYTE;
typedef uint16_t WORD;
typedef uint32_t DWORD;
-#include "necpriv.h"
+#include "necpriv.ipp"
DEFINE_DEVICE_TYPE(V20, v20_device, "v20", "NEC V20")
DEFINE_DEVICE_TYPE(V30, v30_device, "v30", "NEC V30")
diff --git a/src/devices/cpu/nec/necpriv.h b/src/devices/cpu/nec/necpriv.ipp
index 474a95382dc..d2b8bc5c4af 100644
--- a/src/devices/cpu/nec/necpriv.h
+++ b/src/devices/cpu/nec/necpriv.ipp
@@ -1,5 +1,8 @@
// license:BSD-3-Clause
// copyright-holders:Bryan McPhail
+
+namespace {
+
/* Cpu types, steps of 8 to help the cycle count calculation */
#define V33_TYPE 0
#define V30_TYPE 8
@@ -128,3 +131,5 @@ enum BREGS {
m_OverVal = (f) & 0x0800; \
m_MF = (((f) & 0x8000) == 0x8000) || m_em; \
}
+
+} // anonymous namespace
diff --git a/src/devices/cpu/nec/v25.cpp b/src/devices/cpu/nec/v25.cpp
index f4785ba9af0..8a44732d07d 100644
--- a/src/devices/cpu/nec/v25.cpp
+++ b/src/devices/cpu/nec/v25.cpp
@@ -35,6 +35,9 @@
****************************************************************************/
#include "emu.h"
+#include "v25.h"
+#include "necdasm.h"
+
#include "debugger.h"
typedef uint8_t BOOLEAN;
@@ -42,9 +45,8 @@ typedef uint8_t BYTE;
typedef uint16_t WORD;
typedef uint32_t DWORD;
-#include "v25.h"
-#include "v25priv.h"
-#include "necdasm.h"
+#include "v25priv.ipp"
+
DEFINE_DEVICE_TYPE(V25, v25_device, "v25", "NEC V25")
DEFINE_DEVICE_TYPE(V35, v35_device, "v35", "NEC V35")
diff --git a/src/devices/cpu/nec/v25priv.h b/src/devices/cpu/nec/v25priv.ipp
index e212314d1d9..9287344cb53 100644
--- a/src/devices/cpu/nec/v25priv.h
+++ b/src/devices/cpu/nec/v25priv.ipp
@@ -1,5 +1,8 @@
// license:BSD-3-Clause
// copyright-holders:Bryan McPhail, Alex W. Jackson
+
+namespace {
+
/* Cpu types, steps of 8 to help the cycle count calculation */
#define V33_TYPE 0
#define V30_TYPE 8
@@ -186,3 +189,5 @@ enum BREGS {
/* RB only changes on BRKCS/RETRBI/TSKSW, so skip it */ \
m_MF = ((f) & 0x8000) == 0x8000; \
}
+
+} // anonymous namespace
diff --git a/src/devices/cpu/nec/v25sfr.cpp b/src/devices/cpu/nec/v25sfr.cpp
index 7c606a82afd..81d9d5569b0 100644
--- a/src/devices/cpu/nec/v25sfr.cpp
+++ b/src/devices/cpu/nec/v25sfr.cpp
@@ -8,7 +8,7 @@
#include "emu.h"
#include "v25.h"
-#include "v25priv.h"
+#include "v25priv.ipp"
void v25_common_device::ida_sfr_map(address_map &map)
{
diff --git a/src/devices/cpu/nec/v5x.cpp b/src/devices/cpu/nec/v5x.cpp
index 9598d63ea2b..70a065db994 100644
--- a/src/devices/cpu/nec/v5x.cpp
+++ b/src/devices/cpu/nec/v5x.cpp
@@ -30,7 +30,7 @@
#include "emu.h"
#include "v5x.h"
-#include "necpriv.h"
+#include "necpriv.ipp"
#define VERBOSE 0
#include "logmacro.h"