summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author R. Belmont <rb6502@users.noreply.github.com>2011-02-02 03:29:54 +0000
committer R. Belmont <rb6502@users.noreply.github.com>2011-02-02 03:29:54 +0000
commit28e34ea140028da9ca845ebe06f5a3a6fc633c83 (patch)
treeb6a3031ed20027a22651798401747371082973cc
parentfdd736acefcd358e3ac3b5b3141ddaec7fd3f3e2 (diff)
NetBSD support [Thomas Klausner]
Not for whatsnew: I added -Wno-conversion unconditionally to disable the warnings Thomas reported. That setting is the default for GCC out-of-the-box but apparently not on NetBSD. As far as I know it shouldn't cause a problem with any GCC version back to at least 4.0.0 so we're safe even on PPC OSX, but do let me know if hilarity ensues.
-rw-r--r--makefile6
-rw-r--r--src/emu/debug/debugcpu.c2
-rw-r--r--src/emu/emucore.h2
-rw-r--r--src/lib/util/astring.h4
-rw-r--r--src/osd/sdl/sdlsync_ntc.c7
5 files changed, 18 insertions, 3 deletions
diff --git a/makefile b/makefile
index 7190b0ec8d8..95a0655310b 100644
--- a/makefile
+++ b/makefile
@@ -86,6 +86,9 @@ endif
ifeq ($(firstword $(filter GNU/kFreeBSD,$(UNAME))),GNU/kFreeBSD)
TARGETOS = freebsd
endif
+ifeq ($(firstword $(filter NetBSD,$(UNAME))),NetBSD)
+TARGETOS = netbsd
+endif
ifeq ($(firstword $(filter OpenBSD,$(UNAME))),OpenBSD)
TARGETOS = openbsd
endif
@@ -470,7 +473,8 @@ CCOMFLAGS += \
-Wundef \
-Wformat-security \
-Wwrite-strings \
- -Wno-sign-compare
+ -Wno-sign-compare \
+ -Wno-conversion
# warnings only applicable to C compiles
CONLYFLAGS += \
diff --git a/src/emu/debug/debugcpu.c b/src/emu/debug/debugcpu.c
index dc134ca9526..5f162b8253a 100644
--- a/src/emu/debug/debugcpu.c
+++ b/src/emu/debug/debugcpu.c
@@ -51,7 +51,7 @@
#include "xmlfile.h"
#include <ctype.h>
#include <zlib.h>
-#if defined(SDLMAME_FREEBSD) || defined(SDLMAME_OS2)
+#if defined(SDLMAME_FREEBSD) || defined(SDLMAME_NETBSD) || defined(SDLMAME_OS2)
# undef tolower
#endif
diff --git a/src/emu/emucore.h b/src/emu/emucore.h
index 3910c4a2fac..dcd6a603ad1 100644
--- a/src/emu/emucore.h
+++ b/src/emu/emucore.h
@@ -686,6 +686,7 @@ inline void fatalerror_exitcode(running_machine *machine, int exitcode, const ch
//**************************************************************************
// population count
+#ifndef SDLMAME_NETBSD
inline int popcount(UINT32 val)
{
int count;
@@ -694,6 +695,7 @@ inline int popcount(UINT32 val)
val &= val - 1;
return count;
}
+#endif
// convert a series of 32 bits into a float
diff --git a/src/lib/util/astring.h b/src/lib/util/astring.h
index cc0e9cb7b9d..86f45ba02d5 100644
--- a/src/lib/util/astring.h
+++ b/src/lib/util/astring.h
@@ -296,6 +296,10 @@ INLINE astring *astring_assemble_5(astring *dst, const char *src1, const char *s
***************************************************************************/
#ifdef __cplusplus
+#ifdef SDLMAME_NETBSD
+#undef toupper
+#undef tolower
+#endif
/* derived class for C++ */
class astring : public astring_base
diff --git a/src/osd/sdl/sdlsync_ntc.c b/src/osd/sdl/sdlsync_ntc.c
index 28045519185..86866d3808f 100644
--- a/src/osd/sdl/sdlsync_ntc.c
+++ b/src/osd/sdl/sdlsync_ntc.c
@@ -2,7 +2,7 @@
//
// sdlsync.c - SDL core synchronization functions
//
-// Copyright (c) 1996-2010, Nicola Salmoria and the MAME Team.
+// Copyright (c) 1996-2011, Nicola Salmoria and the MAME Team.
// Visit http://mamedev.org for licensing and usage restrictions.
//
// SDLMAME by Olivier Galibert and R. Belmont
@@ -20,6 +20,11 @@
#include <signal.h>
#endif
+#ifdef SDLMAME_NETBSD
+/* for SIGKILL */
+#include <signal.h>
+#endif
+
// standard C headers
#include <math.h>
#include <unistd.h>