From 838f37112efafb57a519495161b9d04f3bc9713c Mon Sep 17 00:00:00 2001 From: Maarten ter Huurne Date: Sat, 30 Aug 2008 08:49:34 +0000 Subject: [PATCH] Fixed compilation on Mac OS X by testing for Linux explicitly instead of assuming that non-Windows equals Linux. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@380 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp | 8 ++++---- Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.h | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp b/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp index 99fdc8b0bf..23be813778 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.cpp @@ -70,7 +70,7 @@ BOOL CALLBACK EnumAxesCallback(const DIDEVICEOBJECTINSTANCE* pdidoi, VOID* pCont HRESULT SetDeviceForcesXY(); #endif -#else +#elif defined(__linux__) int fd; char device_file_name[64]; struct ff_effect effect; @@ -297,7 +297,7 @@ void PAD_Shutdown() #ifdef USE_RUMBLE_DINPUT_HACK FreeDirectInput(); #endif - #else + #elif defined(__linux__) close(fd); #endif } @@ -436,7 +436,7 @@ void PAD_GetStatus(BYTE _numPAD, SPADStatus* _pPADStatus) g_pEffect->Start(1, 0); } #endif - #else + #elif defined(__linux__) if(!fd) { sprintf(device_file_name, "/dev/input/event%d", joysticks[_numPAD].eventnum); //TODO: Make dynamic // @@ -506,7 +506,7 @@ void PAD_Rumble(BYTE _numPAD, unsigned int _uType, unsigned int _uStrength) SetDeviceForcesXY(); } #endif - #else + #elif defined(__linux__) struct input_event event; if(CanRumble) { diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.h b/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.h index 5c22f160ec..dc83e3e091 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.h +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/nJoy.h @@ -58,8 +58,10 @@ #else #include #include -#include #define SLEEP(x) usleep(x*1000) +#endif +#ifdef __linux__ +#include #endif #ifdef USE_WXWIDGETS