From f963fcfa66ff1112dda5d9a120edc6b5dd4546e5 Mon Sep 17 00:00:00 2001 From: Jonathan Li Date: Sun, 1 May 2016 09:54:53 +0100 Subject: [PATCH] onepad:freebsd: Adjust ifdefs --- plugins/onepad/controller.h | 4 ---- plugins/onepad/keyboard.cpp | 6 +++--- plugins/onepad/keyboard.h | 2 +- plugins/onepad/onepad.cpp | 4 ++-- plugins/onepad/onepad.h | 2 +- 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/plugins/onepad/controller.h b/plugins/onepad/controller.h index bd7c9b7297..268090904d 100644 --- a/plugins/onepad/controller.h +++ b/plugins/onepad/controller.h @@ -21,11 +21,7 @@ #pragma once #include // for memset -#ifdef __linux__ #define MAX_KEYS 24 -#else -#define MAX_KEYS 20 -#endif enum KeyType { diff --git a/plugins/onepad/keyboard.cpp b/plugins/onepad/keyboard.cpp index 273809bd6f..ae82eb7bc7 100644 --- a/plugins/onepad/keyboard.cpp +++ b/plugins/onepad/keyboard.cpp @@ -28,7 +28,7 @@ #include #include "keyboard.h" -#ifndef __linux__ +#ifdef _WIN32 char* KeysymToChar(int keysym) { LPWORD temp; @@ -40,7 +40,7 @@ char* KeysymToChar(int keysym) void SetAutoRepeat(bool autorep) { - #ifdef __linux__ +#if defined(__unix__) if (toggleAutoRepeat) { if (autorep) @@ -51,7 +51,7 @@ void SetAutoRepeat(bool autorep) #endif } -#ifdef __linux__ +#if defined(__unix__) static bool s_grab_input = false; static bool s_Shift = false; static unsigned int s_previous_mouse_x = 0; diff --git a/plugins/onepad/keyboard.h b/plugins/onepad/keyboard.h index 0b352b6f7b..84171e6557 100644 --- a/plugins/onepad/keyboard.h +++ b/plugins/onepad/keyboard.h @@ -24,7 +24,7 @@ #include "onepad.h" -#ifdef __linux__ +#if defined(__unix__) #include "Linux/linux.h" diff --git a/plugins/onepad/onepad.cpp b/plugins/onepad/onepad.cpp index b9476deb18..ebaed83eee 100644 --- a/plugins/onepad/onepad.cpp +++ b/plugins/onepad/onepad.cpp @@ -263,7 +263,7 @@ EXPORT_C_(s32) PADopen(void *pDsp) pthread_spin_init(&mutex_KeyEvent, PTHREAD_PROCESS_PRIVATE); mutex_WasInit = true; -#ifdef __linux__ +#if defined(__unix__) GamePad::EnumerateGamePads(s_vgamePad); #endif return _PADopen(pDsp); @@ -595,7 +595,7 @@ EXPORT_C_(keyEvent*) PADkeyEvent() return &s_event; } -#ifdef __linux__ +#if defined(__unix__) EXPORT_C_(void) PADWriteEvent(keyEvent &evt) { // This function call be called before PADopen. Therefore we cann't diff --git a/plugins/onepad/onepad.h b/plugins/onepad/onepad.h index 8b73876eee..235d62eb13 100644 --- a/plugins/onepad/onepad.h +++ b/plugins/onepad/onepad.h @@ -49,7 +49,7 @@ using namespace std; #define PADdefs #include "PS2Edefs.h" -#ifdef __linux__ +#if defined(__unix__) #include "GamePad.h" #endif #include "bitwise.h"