diff --git a/src/gl/system/gl_system.h b/src/gl/system/gl_system.h index db7f1f890d..a8dcd129e4 100644 --- a/src/gl/system/gl_system.h +++ b/src/gl/system/gl_system.h @@ -15,7 +15,7 @@ #include #include #include -#if !defined(__APPLE__) && !defined(__FreeBSD__) +#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__OpenBSD__) #include #endif #include diff --git a/src/m_alloc.cpp b/src/m_alloc.cpp index 3b601d7163..bec5581e32 100644 --- a/src/m_alloc.cpp +++ b/src/m_alloc.cpp @@ -38,6 +38,8 @@ #elif defined(__APPLE__) #include #include +#elif defined(__OpenBSD__) +#include #else #include #endif @@ -52,14 +54,14 @@ #endif #if defined(__APPLE__) #define _msize(p) malloc_size(p) -#elif defined(__sun) +#elif __solaris__ || defined(__OpenBSD__) #define _msize(p) (*((size_t*)(p)-1)) #elif !defined(_WIN32) #define _msize(p) malloc_usable_size(p) // from glibc/FreeBSD #endif #ifndef _DEBUG -#if !defined(__sun) +#if !__solaris__ && !defined(__OpenBSD__) void *M_Malloc(size_t size) { void *block = malloc(size); @@ -129,7 +131,7 @@ void *M_Realloc(void *memblock, size_t size) #include #endif -#if !defined(__sun) +#if !__solaris__ && !defined(__OpenBSD__) void *M_Malloc_Dbg(size_t size, const char *file, int lineno) { void *block = _malloc_dbg(size, _NORMAL_BLOCK, file, lineno); @@ -197,7 +199,7 @@ void *M_Realloc_Dbg(void *memblock, size_t size, const char *file, int lineno) #endif #endif -#if !defined(__sun) +#if !__solaris__ && !defined(__OpenBSD__) void M_Free (void *block) { if (block != NULL) diff --git a/src/posix/i_system.h b/src/posix/i_system.h index 4d0577467b..d56d53e2d4 100644 --- a/src/posix/i_system.h +++ b/src/posix/i_system.h @@ -30,6 +30,8 @@ #include #include +#define __solaris__ (defined(__sun) || defined(__sun__) || defined(__SRV4) || defined(__srv4__)) + #include "doomtype.h" struct ticcmd_t; diff --git a/src/posix/sdl/crashcatcher.c b/src/posix/sdl/crashcatcher.c index 70c9e7b0cb..11e5d179f3 100644 --- a/src/posix/sdl/crashcatcher.c +++ b/src/posix/sdl/crashcatcher.c @@ -5,7 +5,6 @@ #include #include #include -#include #include #include #include @@ -15,7 +14,7 @@ #ifndef PR_SET_PTRACER #define PR_SET_PTRACER 0x59616d61 #endif -#elif defined (__APPLE__) || defined (__FreeBSD__) +#elif defined (__APPLE__) || defined (__FreeBSD__) || defined(__OpenBSD__) #include #endif diff --git a/src/posix/sdl/hardware.cpp b/src/posix/sdl/hardware.cpp index eeb5f6ec4d..b464583707 100644 --- a/src/posix/sdl/hardware.cpp +++ b/src/posix/sdl/hardware.cpp @@ -241,7 +241,7 @@ void I_ClosestResolution (int *width, int *height, int bits) EXTERN_CVAR(Int, vid_maxfps); EXTERN_CVAR(Bool, cl_capfps); -#ifndef __APPLE__ +#if !defined(__APPLE__) && !defined(__OpenBSD__) Semaphore FPSLimitSemaphore; static void FPSLimitNotify(sigval val) @@ -334,8 +334,8 @@ CUSTOM_CVAR(Bool, swtruecolor, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOINITC CUSTOM_CVAR (Bool, fullscreen, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOINITCALL) { - NewWidth = screen->VideoWidth; - NewHeight = screen->VideoHeight; + NewWidth = screen->GetWidth(); + NewHeight = screen->GetHeight(); NewBits = DisplayBits; setmodeneeded = true; } diff --git a/src/posix/sdl/sdlglvideo.cpp b/src/posix/sdl/sdlglvideo.cpp index 6401e52cf3..f09767f58c 100644 --- a/src/posix/sdl/sdlglvideo.cpp +++ b/src/posix/sdl/sdlglvideo.cpp @@ -535,7 +535,7 @@ void SDLGLFB::NewRefreshRate () void SDLGLFB::SwapBuffers() { -#ifndef __APPLE__ +#if !defined(__APPLE__) && !defined(__OpenBSD__) if (vid_maxfps && !cl_capfps) { SEMAPHORE_WAIT(FPSLimitSemaphore) diff --git a/src/posix/sdl/sdlvideo.cpp b/src/posix/sdl/sdlvideo.cpp index 828a47f744..905e2de78a 100644 --- a/src/posix/sdl/sdlvideo.cpp +++ b/src/posix/sdl/sdlvideo.cpp @@ -227,7 +227,7 @@ void SDLFB::Update () DrawRateStuff (); -#ifndef __APPLE__ +#if !defined(__APPLE__) && !defined(__OpenBSD__) if(vid_maxfps && !cl_capfps) { SEMAPHORE_WAIT(FPSLimitSemaphore) diff --git a/src/sound/i_music.cpp b/src/sound/i_music.cpp index 8ee359e8fc..b66e5d0968 100644 --- a/src/sound/i_music.cpp +++ b/src/sound/i_music.cpp @@ -39,7 +39,6 @@ #include #include #include -#include #include "mus2midi.h" extern void ChildSigHandler (int signum); #endif diff --git a/src/sound/mididevices/music_timiditypp_mididevice.cpp b/src/sound/mididevices/music_timiditypp_mididevice.cpp index b6ba6997d3..39a7dcb784 100644 --- a/src/sound/mididevices/music_timiditypp_mididevice.cpp +++ b/src/sound/mididevices/music_timiditypp_mididevice.cpp @@ -46,7 +46,7 @@ #include #include -#include +#include #include int ChildQuit; @@ -523,15 +523,15 @@ bool TimidityPPMIDIDevice::LaunchTimidity () } int forkres; - wordexp_t words = {}; + glob_t glb; - switch (wordexp (CommandLine.GetChars(), &words, 0)) + switch (glob (CommandLine.GetChars(), 0, NULL, &glb)) { case 0: // all good break; - case WRDE_NOSPACE: - wordfree (&words); + case GLOB_NOSPACE: + globfree (&glb); default: return false; } @@ -546,7 +546,7 @@ bool TimidityPPMIDIDevice::LaunchTimidity () // freopen ("/dev/null", "w", stderr); close (WavePipe[1]); - execvp (words.we_wordv[0], words.we_wordv); + execvp (glb.gl_pathv[0], glb.gl_pathv); fprintf(stderr,"execvp failed\n"); _exit (0); // if execvp succeeds, we never get here } @@ -567,7 +567,7 @@ bool TimidityPPMIDIDevice::LaunchTimidity () }*/ } - wordfree (&words); + globfree (&glb); return ChildProcess != -1; #endif // _WIN32 } diff --git a/src/sound/musicformats/music_mus_midiout.cpp b/src/sound/musicformats/music_mus_midiout.cpp index 955c293a78..8058944a7a 100644 --- a/src/sound/musicformats/music_mus_midiout.cpp +++ b/src/sound/musicformats/music_mus_midiout.cpp @@ -33,7 +33,7 @@ // HEADER FILES ------------------------------------------------------------ -#if !defined(__FreeBSD__) && !defined(__APPLE__) +#if !defined(__FreeBSD__) && !defined(__APPLE__) && !defined(__OpenBSD__) #include #else #include