mirror of
https://github.com/lihop/godot-xterm.git
synced 2024-11-10 04:40:25 +01:00
Use standard OS macros
As per: https://sourceforge.net/p/predef/wiki/OperatingSystems/
This commit is contained in:
parent
bb8d40df58
commit
caf3bf1910
4 changed files with 10 additions and 10 deletions
|
@ -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.
|
||||
|
|
|
@ -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<godot::Terminal>();
|
||||
#if defined(PLATFORM_LINUX) || defined(PLATFORM_OSX)
|
||||
#if defined(__unix__)
|
||||
godot::register_class<godot::Pseudoterminal>();
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
#include <unistd.h>
|
||||
|
||||
// Platform specific includes.
|
||||
#if defined(PLATFORM_LINUX)
|
||||
#if defined(__linux__)
|
||||
#include <pty.h>
|
||||
#endif
|
||||
#if defined(PLATFORM_OSX)
|
||||
#if defined(__APPLE__)
|
||||
#include <sys/ioctl.h>
|
||||
#include <util.h>
|
||||
#endif
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include <xkbcommon/xkbcommon-keysyms.h>
|
||||
|
||||
// For _populate_key_list(), see below.
|
||||
#if defined(PLATFORM_WINDOWS)
|
||||
#if defined(__WIN32)
|
||||
#include <GlobalConstants.hpp>
|
||||
#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)
|
||||
|
|
Loading…
Reference in a new issue