From 556bc155403f185c13de0eddd9020f7a703af708 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 20 Feb 2006 03:57:03 +0000 Subject: [PATCH] NetBSD support --- configure.in | 14 +++++--------- include/SDL_config.h.in | 2 +- src/timer/unix/SDL_systimer.c | 5 ----- src/video/wscons/SDL_wsconsevents.c | 2 ++ src/video/wscons/SDL_wsconsvideo.c | 2 ++ 5 files changed, 10 insertions(+), 15 deletions(-) diff --git a/configure.in b/configure.in index 37d61b6c7..ed2836944 100644 --- a/configure.in +++ b/configure.in @@ -287,7 +287,7 @@ AC_HELP_STRING([--enable-oss], [support the OSS audio API [default=yes]]), # OpenBSD needs linking with ossaudio emulation library case "$target" in - *-*-openbsd*) + *-*-openbsd*|*-*-netbsd*) BUILD_LIBS="$BUILD_LIBS -lossaudio";; esac fi @@ -1483,7 +1483,7 @@ AC_HELP_STRING([--enable-pthread-sem], [use pthread semaphores [default=yes]]), pthread_lib="-pthread" ;; *-*-netbsd*) - pthread_cflags="-I/usr/include -D_REENTRANT -D_THREAD_SAFE -D_POSIX_THREAD_SYSCALL_SOFT=1" + pthread_cflags="-D_REENTRANT -D_THREAD_SAFE" pthread_lib="-L/usr/lib -lpthread" ;; *-*-openbsd*) @@ -1976,7 +1976,7 @@ case "$target" in SOURCES="$SOURCES $srcdir/src/cdrom/freebsd/*.c" have_cdrom=yes ;; - *netbsd*|*openbsd*) + *openbsd*|*netbsd*) AC_DEFINE(SDL_CDROM_OPENBSD) SOURCES="$SOURCES $srcdir/src/cdrom/openbsd/*.c" have_cdrom=yes @@ -2014,12 +2014,8 @@ case "$target" in fi # Do any final platform setup case $ARCH in - netbsd) - # NetBSD does not define "unix" - BUILD_CFLAGS="$BUILD_CFLAGS -Dunix" - ;; - openbsd) - # OpenBSD does not define "unix" + openbsd|netbsd) + # OpenBSD and NetBSD do not define "unix" BUILD_CFLAGS="$BUILD_CFLAGS -Dunix" ;; esac diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in index e6b0adafa..d2cdedcf5 100644 --- a/include/SDL_config.h.in +++ b/include/SDL_config.h.in @@ -38,10 +38,10 @@ #undef uint16_t #undef int32_t #undef uint32_t -#undef SDL_HAS_64BIT_TYPE #undef int64_t #undef uint64_t #undef uintptr_t +#undef SDL_HAS_64BIT_TYPE /* Endianness */ #undef SDL_BYTEORDER diff --git a/src/timer/unix/SDL_systimer.c b/src/timer/unix/SDL_systimer.c index 704c0784c..a6cbe7df2 100644 --- a/src/timer/unix/SDL_systimer.c +++ b/src/timer/unix/SDL_systimer.c @@ -41,8 +41,6 @@ #if SDL_THREAD_PTH #include -#elif _POSIX_THREAD_SYSCALL_SOFT -#include #endif #if SDL_THREADS_DISABLED @@ -111,9 +109,6 @@ void SDL_Delay (Uint32 ms) do { errno = 0; -#if _POSIX_THREAD_SYSCALL_SOFT - pthread_yield_np(); -#endif #if HAVE_NANOSLEEP tv.tv_sec = elapsed.tv_sec; tv.tv_nsec = elapsed.tv_nsec; diff --git a/src/video/wscons/SDL_wsconsevents.c b/src/video/wscons/SDL_wsconsevents.c index 7ea9bc59d..510348d14 100644 --- a/src/video/wscons/SDL_wsconsevents.c +++ b/src/video/wscons/SDL_wsconsevents.c @@ -146,6 +146,7 @@ void WSCONS_InitOSKeymap(_THIS) } switch (private->kbdType) { +#ifdef WSKBD_TYPE_ZAURUS case WSKBD_TYPE_ZAURUS: /* top row */ keymap[2] = SDLK_1; @@ -219,6 +220,7 @@ void WSCONS_InitOSKeymap(_THIS) keymap[77] = SDLK_RIGHT; keymap[80] = SDLK_DOWN; break; +#endif /* WSKBD_TYPE_ZAURUS */ default: WSCONS_ReportError("Unable to map keys for keyboard type %u", diff --git a/src/video/wscons/SDL_wsconsvideo.c b/src/video/wscons/SDL_wsconsvideo.c index fc0238e5a..526315bd8 100644 --- a/src/video/wscons/SDL_wsconsvideo.c +++ b/src/video/wscons/SDL_wsconsvideo.c @@ -191,10 +191,12 @@ int WSCONS_VideoInit(_THIS, SDL_PixelFormat *vformat) private->redMask = 0x0000ff; private->greenMask = 0x00ff00; private->blueMask = 0xff0000; +#ifdef WSDISPLAY_TYPE_PXALCD } else if (wstype == WSDISPLAY_TYPE_PXALCD) { private->redMask = 0x1f << 11; private->greenMask = 0x3f << 5; private->blueMask = 0x1f; +#endif } else { WSCONS_ReportError("Unknown video hardware"); return -1;