From 93d03d0e1a2a746a1efc51fc83dbcf1ad3e35a85 Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Mon, 13 Oct 2014 14:57:14 +0700 Subject: [PATCH] Correct OS names in code and project files. --- CMakeLists.txt | 24 +++++++++++++++++------- CommonPluginAPI.cpp | 4 ++-- GLideN64.vcxproj | 8 ++++---- OpenGL.h | 9 +++++++-- RSP.cpp | 6 +++--- ZilmarGFX_1_3.h | 2 +- ZilmarPluginAPI.cpp | 4 ++-- common/CommonAPIImpl_common.cpp | 4 ++-- common/ZilmarAPIImpl_common.cpp | 4 ++-- mupenplus/Config.cpp | 2 +- mupenplus/MupenPlusAPIImpl.cpp | 4 ++-- mupenplus/OpenGL_mupenplus.cpp | 2 +- windows/Debug.cpp | 2 +- 13 files changed, 45 insertions(+), 30 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cf30e139..ab85827b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -39,7 +39,7 @@ if(MUPENPLUSAPI) -DMUPENPLUSAPI ) include_directories( inc ) - set(GLideN64_SOURCES_LINUX + set(GLideN64_SOURCES_UNIX MupenPlusPluginAPI.cpp mupenplus/Config.cpp mupenplus/CommonAPIImpl_mupenplus.cpp @@ -47,7 +47,7 @@ if(MUPENPLUSAPI) mupenplus/MupenPlusAPIImpl.cpp mupenplus/OpenGL_mupenplus.cpp ) - set(GLideN64_SOURCES_WIN ${GLideN64_SOURCES_LINUX} + set(GLideN64_SOURCES_WIN ${GLideN64_SOURCES_UNIX} windows/GLFunctions.cpp ) else(MUPENPLUSAPI) @@ -63,7 +63,7 @@ else(MUPENPLUSAPI) windows/OpenGL_windows.cpp windows/ZilmarAPIImpl_windows.cpp ) - set(GLideN64_SOURCES_LINUX + set(GLideN64_SOURCES_UNIX ZilmarPluginAPI.cpp common/ZilmarAPIImpl_common.cpp posix/Config.cpp @@ -76,9 +76,18 @@ else(MUPENPLUSAPI) endif(MUPENPLUSAPI) if(UNIX) - list(APPEND GLideN64_SOURCES ${GLideN64_SOURCES_LINUX}) + list(APPEND GLideN64_SOURCES ${GLideN64_SOURCES_UNIX}) + if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + add_definitions( + -DOS_MAC_OS_X + ) + elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + add_definitions( + -DOS_LINUX + ) + endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + if( NOT MUPENPLUSAPI) add_definitions( - -D__LINUX__ -D_DEBUG ) find_package(PkgConfig) @@ -86,15 +95,16 @@ if(UNIX) include_directories(${GLIB_INCLUDE_DIRS}) find_package(GTK2 REQUIRED) include_directories(${GTK2_INCLUDE_DIRS}) + endif( NOT MUPENPLUSAPI) endif(UNIX) if(WIN32) list(APPEND GLideN64_SOURCES ${GLideN64_SOURCES_WIN}) add_definitions( - -D_WINDOWS + -DOS_WINDOWS -D__WIN32__ -DWIN32 - -D_WIN32_ + -D_WIN32_ASM -D_CRT_SECURE_NO_WARNINGS -D__MSC__ ) diff --git a/CommonPluginAPI.cpp b/CommonPluginAPI.cpp index 6981c08d..707cb0cb 100644 --- a/CommonPluginAPI.cpp +++ b/CommonPluginAPI.cpp @@ -1,8 +1,8 @@ -#ifdef _WINDOWS +#ifdef OS_WINDOWS # include #else # include "winlnxdefs.h" -#endif // _WINDOWS +#endif // OS_WINDOWS #include "PluginAPI.h" diff --git a/GLideN64.vcxproj b/GLideN64.vcxproj index 3b41d72e..0d57686d 100644 --- a/GLideN64.vcxproj +++ b/GLideN64.vcxproj @@ -113,7 +113,7 @@ Disabled - WIN32_ASM;_WINDOWS;_USRDLL;NEWGLNINTENDO64_EXPORTS;%(PreprocessorDefinitions) + WIN32_ASM;OS_WINDOWS;_USRDLL;NEWGLNINTENDO64_EXPORTS;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebug @@ -137,7 +137,7 @@ Disabled - MUPENPLUSAPI;WIN32;_WINDOWS;_USRDLL;NEWGLNINTENDO64_EXPORTS;%(PreprocessorDefinitions) + MUPENPLUSAPI;WIN32;OS_WINDOWS;_USRDLL;NEWGLNINTENDO64_EXPORTS;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebug @@ -166,7 +166,7 @@ true Speed true - WIN32_ASM;_WINDOWS;_USRDLL;NEWGLNINTENDO64_EXPORTS;%(PreprocessorDefinitions) + WIN32_ASM;OS_WINDOWS;_USRDLL;NEWGLNINTENDO64_EXPORTS;%(PreprocessorDefinitions) true MultiThreaded true @@ -194,7 +194,7 @@ true Speed true - MUPENPLUSAPI;WIN32;WIN32_ASM;_WINDOWS;_USRDLL;NEWGLNINTENDO64_EXPORTS;%(PreprocessorDefinitions) + MUPENPLUSAPI;WIN32;WIN32_ASM;OS_WINDOWS;_USRDLL;NEWGLNINTENDO64_EXPORTS;%(PreprocessorDefinitions) true MultiThreaded true diff --git a/OpenGL.h b/OpenGL.h index 70ed22aa..82da4008 100644 --- a/OpenGL.h +++ b/OpenGL.h @@ -2,7 +2,7 @@ #define OPENGL_H #include -#ifdef _WINDOWS +#ifdef OS_WINDOWS #include #include #include "glext.h" @@ -16,13 +16,18 @@ #define GL_READ_FRAMEBUFFER GL_FRAMEBUFFER #else #define GL_GLEXT_PROTOTYPES +#if defined(OS_MAC_OS_X) +#include +#include +#elif defined(OS_LINUX) #include #include +#endif // OS_MAC_OS_X #endif // GLES2 #ifdef USE_SDL #include #endif // USE_SDL -#endif // _WINDOWS +#endif // OS_WINDOWS #include "gSP.h" diff --git a/RSP.cpp b/RSP.cpp index cab5321d..eac29800 100644 --- a/RSP.cpp +++ b/RSP.cpp @@ -240,7 +240,7 @@ void RSP_ProcessDList() void RSP_Init() { -#ifdef _WINDOWS +#ifdef OS_WINDOWS // Calculate RDRAM size by intentionally causing an access violation u32 test; try @@ -255,9 +255,9 @@ void RSP_Init() RDRAMSize = 0x7FFFFF; else RDRAMSize = 0x3FFFFF; -#else // _WINDOWS +#else // OS_WINDOWS RDRAMSize = 1024 * 1024 * 8; -#endif // _WINDOWS +#endif // OS_WINDOWS RSP.DList = 0; RSP.uc_start = RSP.uc_dstart = 0; diff --git a/ZilmarGFX_1_3.h b/ZilmarGFX_1_3.h index eb775ef9..f1cde0f1 100644 --- a/ZilmarGFX_1_3.h +++ b/ZilmarGFX_1_3.h @@ -26,7 +26,7 @@ extern "C" { /* Plugin types */ #define PLUGIN_TYPE_GFX 2 -#ifdef _WINDOWS +#ifdef OS_WINDOWS #define EXPORT __declspec(dllexport) #define CALL __cdecl #else diff --git a/ZilmarPluginAPI.cpp b/ZilmarPluginAPI.cpp index 4524d767..d529a2dc 100644 --- a/ZilmarPluginAPI.cpp +++ b/ZilmarPluginAPI.cpp @@ -1,8 +1,8 @@ -#ifdef _WINDOWS +#ifdef OS_WINDOWS # include #else # include "winlnxdefs.h" -#endif // _WINDOWS +#endif // OS_WINDOWS #include "PluginAPI.h" diff --git a/common/CommonAPIImpl_common.cpp b/common/CommonAPIImpl_common.cpp index 89f83f99..f0c94155 100644 --- a/common/CommonAPIImpl_common.cpp +++ b/common/CommonAPIImpl_common.cpp @@ -1,8 +1,8 @@ -#ifdef _WINDOWS +#ifdef OS_WINDOWS # include #else # include "../winlnxdefs.h" -#endif // _WINDOWS +#endif // OS_WINDOWS #include #include "../PluginAPI.h" diff --git a/common/ZilmarAPIImpl_common.cpp b/common/ZilmarAPIImpl_common.cpp index 23e277c5..34866203 100644 --- a/common/ZilmarAPIImpl_common.cpp +++ b/common/ZilmarAPIImpl_common.cpp @@ -1,8 +1,8 @@ -#ifdef _WINDOWS +#ifdef OS_WINDOWS # include #else # include "../winlnxdefs.h" -#endif // _WINDOWS +#endif // OS_WINDOWS #include "../PluginAPI.h" diff --git a/mupenplus/Config.cpp b/mupenplus/Config.cpp index f94d6b71..1b6668d7 100644 --- a/mupenplus/Config.cpp +++ b/mupenplus/Config.cpp @@ -175,7 +175,7 @@ void Config_SetOption(char* line, char* val) { for (int i = 0; i< configOptionsSize; i++) { Option *o = &configOptions[i]; -#ifndef _WINDOWS +#ifndef OS_WINDOWS if (strcasecmp(line, o->name) == 0) { #else if (_stricmp(line, o->name) == 0) { diff --git a/mupenplus/MupenPlusAPIImpl.cpp b/mupenplus/MupenPlusAPIImpl.cpp index 00fbff0a..91250449 100644 --- a/mupenplus/MupenPlusAPIImpl.cpp +++ b/mupenplus/MupenPlusAPIImpl.cpp @@ -3,11 +3,11 @@ #include "../GLideN64.h" #include "../OpenGL.h" -#ifdef _WINDOWS +#ifdef OS_WINDOWS #define DLSYM(a, b) GetProcAddress(a, b) #else #define DLSYM(a, b) dlsym(a, b) -#endif // _WINDOWS +#endif // OS_WINDOWS ptr_ConfigGetSharedDataFilepath ConfigGetSharedDataFilepath = NULL; ptr_ConfigGetUserConfigPath ConfigGetUserConfigPath = NULL; diff --git a/mupenplus/OpenGL_mupenplus.cpp b/mupenplus/OpenGL_mupenplus.cpp index c8aae1d1..8af4ad7e 100644 --- a/mupenplus/OpenGL_mupenplus.cpp +++ b/mupenplus/OpenGL_mupenplus.cpp @@ -7,7 +7,7 @@ #include "../Config.h" #include "../Revision.h" -#ifndef _WINDOWS +#ifndef OS_WINDOWS void initGLFunctions() { diff --git a/windows/Debug.cpp b/windows/Debug.cpp index cf356b60..80d2472e 100644 --- a/windows/Debug.cpp +++ b/windows/Debug.cpp @@ -1,4 +1,4 @@ -#if defined(USE_DEBUG) && defined(_WINDOWS) +#if defined(USE_DEBUG) && defined(OS_WINDOWS) #include "GLideN64_Windows.h" #include