diff --git a/addons/godot_xterm/native/SConstruct b/addons/godot_xterm/native/SConstruct index d5f58e6..6ef6a7d 100644 --- a/addons/godot_xterm/native/SConstruct +++ b/addons/godot_xterm/native/SConstruct @@ -72,7 +72,7 @@ env.AppendENVPath('PATH', os.getenv('PATH')) # Compile for Linux. if env['platform'] == 'linux': - env.Append(CPPDEFINES=['PLATFORM_LINUX']) + env.Append(CPPDEFINES=['__linux__']) env['CC'] = 'gcc' env['CXX'] = 'g++' @@ -95,7 +95,7 @@ if env['platform'] == 'linux': # Compile for HTML5. elif env['platform'] == 'javascript': - env.Append(CPPDEFINES=['PLATFORM_JS']) + env.Append(CPPDEFINES=['__EMSCRIPTEN__']) env['bits'] = '32' env['CC'] = 'emcc' @@ -118,7 +118,7 @@ elif env['platform'] == 'javascript': # Compile for OSX. elif env['platform'] == 'osx': - env.Append(CPPDEFINES=['PLATFORM_OSX']) + env.Append(CPPDEFINES=['__APPLE__']) env['CC'] = 'clang' env['CXX'] = 'clang++' @@ -144,7 +144,7 @@ elif env['platform'] == 'osx': # Compile for Windows. elif env['platform'] == 'windows': - env.Append(CPPDEFINES=['PLATFORM_WINDOWS']) + env.Append(CPPDEFINES=['__WIN32']) env['LIBSUFFIX'] = '.lib' # On Windows using MSVC. diff --git a/addons/godot_xterm/native/src/libgodotxtermnative.cpp b/addons/godot_xterm/native/src/libgodotxtermnative.cpp index 0664156..3a4a6f6 100644 --- a/addons/godot_xterm/native/src/libgodotxtermnative.cpp +++ b/addons/godot_xterm/native/src/libgodotxtermnative.cpp @@ -1,5 +1,5 @@ #include "terminal.h" -#if defined(PLATFORM_LINUX) || defined(PLATFORM_OSX) +#if defined(__unix__) // Linux and macOS. #include "pseudoterminal.h" #endif @@ -16,7 +16,7 @@ extern "C" void GDN_EXPORT godot_nativescript_init(void *handle) { godot::Godot::nativescript_init(handle); godot::register_tool_class(); -#if defined(PLATFORM_LINUX) || defined(PLATFORM_OSX) +#if defined(__unix__) godot::register_class(); #endif } diff --git a/addons/godot_xterm/native/src/pseudoterminal.cpp b/addons/godot_xterm/native/src/pseudoterminal.cpp index 0708b96..09666cc 100644 --- a/addons/godot_xterm/native/src/pseudoterminal.cpp +++ b/addons/godot_xterm/native/src/pseudoterminal.cpp @@ -5,10 +5,10 @@ #include // Platform specific includes. -#if defined(PLATFORM_LINUX) +#if defined(__linux__) #include #endif -#if defined(PLATFORM_OSX) +#if defined(__APPLE__) #include #include #endif diff --git a/addons/godot_xterm/native/src/terminal.cpp b/addons/godot_xterm/native/src/terminal.cpp index 425c999..cc271d6 100644 --- a/addons/godot_xterm/native/src/terminal.cpp +++ b/addons/godot_xterm/native/src/terminal.cpp @@ -8,7 +8,7 @@ #include // For _populate_key_list(), see below. -#if defined(PLATFORM_WINDOWS) +#if defined(__WIN32) #include #endif @@ -26,7 +26,7 @@ void Terminal::_populate_key_list() { // referenced in function "private: static void __cdecl // godot::Terminal::_populate_key_list(void)"` so use the old technique of // getting KeyList values from GlobalConstants header for now. -#if defined(PLATFORM_WINDOWS) +#if defined(__WIN32) #define GLOBAL_CONSTANT(VAR) GlobalConstants::VAR #else #define GLOBAL_CONSTANT(VAR) get_constant(#VAR)