Skip to content

Commit

Permalink
Merge pull request #302 from chaigler/openbsd_fixes
Browse files Browse the repository at this point in the history
OpenBSD Fixes
  • Loading branch information
greenfire27 committed Dec 23, 2015
2 parents 5dc2b42 + c3de7c3 commit 419c2c8
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions engine/source/audio/audio.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2474,7 +2474,7 @@ bool OpenALInit()
return false;

// Create an openAL context
#ifdef TORQUE_OS_LINUX
#if defined(TORQUE_OS_LINUX) || defined(TORQUE_OS_OPENBSD)
int freq = Con::getIntVariable("Pref::Unix::OpenALFrequency");
if (freq == 0)
freq = 22050;
Expand Down Expand Up @@ -2504,7 +2504,7 @@ bool OpenALInit()
return false;

// Make this context the active context
#if defined(TORQUE_OS_ANDROID) || defined(TORQUE_OS_LINUX) || defined(TORQUE_OS_EMSCRIPTEN)
#if defined(TORQUE_OS_ANDROID) || defined(TORQUE_OS_LINUX) || defined(TORQUE_OS_EMSCRIPTEN) || defined(TORQUE_OS_OPENBSD)
alcMakeContextCurrent((ALCcontext*)mContext);
#else
alcMakeContextCurrent(mContext);
Expand Down Expand Up @@ -2590,7 +2590,7 @@ void OpenALShutdown()

if (mContext)
{
#if defined(TORQUE_OS_ANDROID) || defined(TORQUE_OS_LINUX)
#if defined(TORQUE_OS_ANDROID) || defined(TORQUE_OS_LINUX) || defined(TORQUE_OS_OPENBSD)
alcDestroyContext((ALCcontext*)mContext);
#elif defined(TORQUE_OS_EMSCRIPTEN)
alcDestroyContext((ALCcontext*)mContext);
Expand All @@ -2602,7 +2602,7 @@ void OpenALShutdown()
}
if (mDevice)
{
#if defined(TORQUE_OS_ANDROID) || defined(TORQUE_OS_LINUX)
#if defined(TORQUE_OS_ANDROID) || defined(TORQUE_OS_LINUX) || defined(TORQUE_OS_OPENBSD)
alcCloseDevice((ALCdevice*)mDevice);
#elif defined(TORQUE_OS_EMSCRIPTEN)
alcCloseDevice((ALCdevice*)mDevice);
Expand Down
2 changes: 1 addition & 1 deletion engine/source/platform/platformAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
//Android uses openal soft from https://github.com/AerialX/openal-soft-android
#include <AL/al.h>
#include <AL/alc.h>
#elif defined(TORQUE_OS_LINUX)
#elif defined(TORQUE_OS_LINUX) || defined(TORQUE_OS_OPENBSD)
#include <AL/al.h>
#include <AL/alc.h>
#include "platform/eaxtypes.h"
Expand Down
2 changes: 1 addition & 1 deletion engine/source/platform/platformFileIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "platform/platform.h"
#endif

#ifdef TORQUE_OS_LINUX
#if defined(TORQUE_OS_LINUX) || defined(TORQUE_OS_OPENBSD)
// Need to remove this once Xlib stops leaking
#undef Status
#endif
Expand Down
12 changes: 6 additions & 6 deletions engine/source/platformX86UNIX/x86UNIXCPUInfo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ void detectX86CPUInfo(char *vendor, U32 *processor, U32 *properties);
}

/* used in the asm */
static U32 time[2];
static U32 Ttime[2];
static U32 clockticks = 0;
static char vendor[13] = {0,};
static U32 properties = 0;
Expand All @@ -59,7 +59,7 @@ void Processor::init()
PlatformSystemInfo.processor.mhz = 0;
PlatformSystemInfo.processor.properties = CPU_PROP_C;

clockticks = properties = processor = time[0] = 0;
clockticks = properties = processor = Ttime[0] = 0;
dStrcpy(vendor, "");

detectX86CPUInfo(vendor, &processor, &properties);
Expand All @@ -82,8 +82,8 @@ void Processor::init()
"pushl %eax\n"
"pushl %edx\n"
"rdtsc\n"
"movl %eax, (time)\n"
"movl %edx, (time+4)\n"
"movl %eax, (Ttime)\n"
"movl %edx, (Ttime+4)\n"
"popl %edx\n"
"popl %eax\n"
);
Expand All @@ -102,8 +102,8 @@ void Processor::init()
"pushl %eax\n"
"pushl %edx\n"
"rdtsc\n"
"sub (time+4), %edx\n"
"sbb (time), %eax\n"
"sub (Ttime+4), %edx\n"
"sbb (Ttime), %eax\n"
"mov %eax, (clockticks)\n"
"popl %edx\n"
"popl %eax\n"
Expand Down
2 changes: 1 addition & 1 deletion engine/source/platformX86UNIX/x86UNIXProcessControl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ void ProcessControlInit()

// we're not interested in the exit status of child processes, so this
// prevents zombies from accumulating.
#if defined(__FreeBSD__)
#if defined(__FreeBSD__) || defined(__OpenBSD__)
signal(SIGCHLD, SIG_IGN);
#else
signal(SIGCLD, SIG_IGN);
Expand Down

0 comments on commit 419c2c8

Please sign in to comment.