summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/netlist/plib/pconfig.h
diff options
context:
space:
mode:
author couriersud <couriersud@arcor.de>2015-05-27 13:47:22 +0200
committer couriersud <couriersud@arcor.de>2015-05-27 23:18:44 +0200
commitcef370aa13953c3bcfa185c818c76812c34f13fc (patch)
tree6ecc90526c03f1e2411328ac2e3d635f9b952922 /src/emu/netlist/plib/pconfig.h
parente9fe1e74c46f40379bcdc472b97c4aef4d3a91e6 (diff)
Moved all files in src/emu/netlist starting with p into plib folder.
This is a first step to ease synchronisation with a stand alone, e.g. outside mame, netlist implementation. More signed/unsigned cleanups and started work on generic truthtable devices. (nw)
Diffstat (limited to 'src/emu/netlist/plib/pconfig.h')
-rw-r--r--src/emu/netlist/plib/pconfig.h99
1 files changed, 99 insertions, 0 deletions
diff --git a/src/emu/netlist/plib/pconfig.h b/src/emu/netlist/plib/pconfig.h
new file mode 100644
index 00000000000..6c00cdd3411
--- /dev/null
+++ b/src/emu/netlist/plib/pconfig.h
@@ -0,0 +1,99 @@
+// license:GPL-2.0+
+// copyright-holders:Couriersud
+/*
+ * pconfig.h
+ *
+ */
+
+#ifndef PCONFIG_H_
+#define PCONFIG_H_
+
+#ifndef PSTANDALONE
+ #define PSTANDALONE (0)
+#endif
+
+//============================================================
+// Compiling standalone
+//============================================================
+
+// Compiling without mame ?
+
+#include <algorithm>
+#include <cstdarg>
+
+#if !(PSTANDALONE)
+#include "osdcore.h"
+
+#undef ATTR_COLD
+#define ATTR_COLD
+
+#else
+#include <stdint.h>
+
+/* not supported in GCC prior to 4.4.x */
+/* ATTR_HOT and ATTR_COLD cause performance degration in 5.1 */
+//#define ATTR_HOT
+//#define ATTR_COLD
+#define ATTR_HOT __attribute__((hot))
+#define ATTR_COLD __attribute__((cold))
+
+#define RESTRICT
+#define EXPECTED(x) (x)
+#define UNEXPECTED(x) (x)
+#define ATTR_PRINTF(x,y) __attribute__((format(printf, x, y)))
+#define ATTR_UNUSED __attribute__((__unused__))
+
+/* 8-bit values */
+typedef unsigned char UINT8;
+typedef signed char INT8;
+
+/* 16-bit values */
+typedef unsigned short UINT16;
+typedef signed short INT16;
+
+/* 32-bit values */
+#ifndef _WINDOWS_H
+typedef unsigned int UINT32;
+typedef signed int INT32;
+#endif
+
+/* 64-bit values */
+#ifndef _WINDOWS_H
+#ifdef _MSC_VER
+typedef signed __int64 INT64;
+typedef unsigned __int64 UINT64;
+#else
+typedef uint64_t UINT64;
+typedef int64_t INT64;
+#endif
+#endif
+
+/* U64 and S64 are used to wrap long integer constants. */
+#if defined(__GNUC__) || defined(_MSC_VER)
+#define U64(val) val##ULL
+#define S64(val) val##LL
+#else
+#define U64(val) val
+#define S64(val) val
+#endif
+
+/* MINGW has adopted the MSVC formatting for 64-bit ints as of gcc 4.4 */
+#if (defined(__MINGW32__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))) || defined(_MSC_VER)
+#define I64FMT "I64"
+#else
+#define I64FMT "ll"
+#endif
+
+#if defined(_MSC_VER) || defined(__MINGW32__)
+#ifdef PTR64
+#define SIZETFMT "I64u"
+#else
+#define SIZETFMT "u"
+#endif
+#else
+#define SIZETFMT "zu"
+#endif
+
+#endif
+
+#endif /* PCONFIG_H_ */