summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/android/detect.py2
-rw-r--r--platform/android/export/export.cpp2
-rw-r--r--platform/haiku/detect.py4
-rw-r--r--platform/iphone/detect.py10
-rw-r--r--platform/iphone/export/export.cpp2
-rw-r--r--platform/javascript/detect.py2
-rw-r--r--platform/osx/detect.py2
-rw-r--r--platform/osx/export/export.cpp1
-rw-r--r--platform/server/detect.py4
-rw-r--r--platform/uwp/detect.py4
-rw-r--r--platform/windows/detect.py6
-rw-r--r--platform/x11/crash_handler_x11.cpp10
-rw-r--r--platform/x11/detect.py4
-rw-r--r--platform/x11/os_x11.cpp72
-rw-r--r--platform/x11/power_x11.cpp2
15 files changed, 63 insertions, 64 deletions
diff --git a/platform/android/detect.py b/platform/android/detect.py
index 6c67067db7..8d35617d20 100644
--- a/platform/android/detect.py
+++ b/platform/android/detect.py
@@ -299,7 +299,7 @@ def configure(env):
env.Append(LIBPATH=[env["ANDROID_NDK_ROOT"] +
'/toolchains/' + target_subpath + '/prebuilt/' + host_subpath + '/' + abi_subpath + '/lib'])
- env.Append(CPPPATH=['#platform/android'])
+ env.Prepend(CPPPATH=['#platform/android'])
env.Append(CPPFLAGS=['-DANDROID_ENABLED', '-DUNIX_ENABLED', '-DNO_FCNTL'])
env.Append(LIBS=['OpenSLES', 'EGL', 'GLESv3', 'android', 'log', 'z', 'dl'])
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp
index 2a3d0843a8..f45644f1eb 100644
--- a/platform/android/export/export.cpp
+++ b/platform/android/export/export.cpp
@@ -1864,7 +1864,6 @@ public:
return ERR_FILE_NOT_FOUND;
}
- ERR_FAIL_COND_V(!pkg, ERR_CANT_OPEN);
int ret = unzGoToFirstFile(pkg);
zlib_filefunc_def io2 = io;
@@ -2204,7 +2203,6 @@ public:
return ERR_FILE_NOT_FOUND;
}
- ERR_FAIL_COND_V(!tmp_unaligned, ERR_CANT_OPEN);
ret = unzGoToFirstFile(tmp_unaligned);
io2 = io;
diff --git a/platform/haiku/detect.py b/platform/haiku/detect.py
index 874b1ab1fb..f33c77a407 100644
--- a/platform/haiku/detect.py
+++ b/platform/haiku/detect.py
@@ -137,7 +137,7 @@ def configure(env):
if not env['builtin_miniupnpc']:
# No pkgconfig file so far, hardcode default paths.
- env.Append(CPPPATH=["/system/develop/headers/x86/miniupnpc"])
+ env.Prepend(CPPPATH=["/system/develop/headers/x86/miniupnpc"])
env.Append(LIBS=["miniupnpc"])
# On Linux wchar_t should be 32-bits
@@ -147,7 +147,7 @@ def configure(env):
## Flags
- env.Append(CPPPATH=['#platform/haiku'])
+ env.Prepend(CPPPATH=['#platform/haiku'])
env.Append(CPPFLAGS=['-DUNIX_ENABLED', '-DOPENGL_ENABLED', '-DGLES_ENABLED'])
env.Append(CPPFLAGS=['-DMEDIA_KIT_ENABLED'])
# env.Append(CPPFLAGS=['-DFREETYPE_ENABLED'])
diff --git a/platform/iphone/detect.py b/platform/iphone/detect.py
index d56e28a4af..3ed0a4ade7 100644
--- a/platform/iphone/detect.py
+++ b/platform/iphone/detect.py
@@ -165,12 +165,12 @@ def configure(env):
if env['icloud']:
env.Append(CPPFLAGS=['-DICLOUD_ENABLED'])
- env.Append(CPPPATH=['$IPHONESDK/usr/include',
- '$IPHONESDK/System/Library/Frameworks/OpenGLES.framework/Headers',
- '$IPHONESDK/System/Library/Frameworks/AudioUnit.framework/Headers',
- ])
+ env.Prepend(CPPPATH=['$IPHONESDK/usr/include',
+ '$IPHONESDK/System/Library/Frameworks/OpenGLES.framework/Headers',
+ '$IPHONESDK/System/Library/Frameworks/AudioUnit.framework/Headers',
+ ])
env['ENV']['CODESIGN_ALLOCATE'] = '/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate'
- env.Append(CPPPATH=['#platform/iphone'])
+ env.Prepend(CPPPATH=['#platform/iphone'])
env.Append(CPPFLAGS=['-DIPHONE_ENABLED', '-DUNIX_ENABLED', '-DGLES_ENABLED', '-DCOREAUDIO_ENABLED'])
diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp
index 85d4b9e847..e1083aeefc 100644
--- a/platform/iphone/export/export.cpp
+++ b/platform/iphone/export/export.cpp
@@ -920,7 +920,7 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p
EditorNode::add_io_error("Could not open export template (not a zip file?):\n" + src_pkg_name);
return ERR_CANT_OPEN;
}
- ERR_FAIL_COND_V(!src_pkg_zip, ERR_CANT_OPEN);
+
int ret = unzGoToFirstFile(src_pkg_zip);
Vector<uint8_t> project_file_data;
while (ret == UNZ_OK) {
diff --git a/platform/javascript/detect.py b/platform/javascript/detect.py
index c7acbde3f7..145ce8d83d 100644
--- a/platform/javascript/detect.py
+++ b/platform/javascript/detect.py
@@ -103,7 +103,7 @@ def configure(env):
## Compile flags
- env.Append(CPPPATH=['#platform/javascript'])
+ env.Prepend(CPPPATH=['#platform/javascript'])
env.Append(CPPDEFINES=['JAVASCRIPT_ENABLED', 'UNIX_ENABLED'])
# No multi-threading (SharedArrayBuffer) available yet,
diff --git a/platform/osx/detect.py b/platform/osx/detect.py
index 8024897195..4c88f91d13 100644
--- a/platform/osx/detect.py
+++ b/platform/osx/detect.py
@@ -126,7 +126,7 @@ def configure(env):
## Flags
- env.Append(CPPPATH=['#platform/osx'])
+ env.Prepend(CPPPATH=['#platform/osx'])
env.Append(CPPFLAGS=['-DOSX_ENABLED', '-DUNIX_ENABLED', '-DGLES_ENABLED', '-DAPPLE_STYLE_KEYS', '-DCOREAUDIO_ENABLED', '-DCOREMIDI_ENABLED'])
env.Append(LINKFLAGS=['-framework', 'Cocoa', '-framework', 'Carbon', '-framework', 'OpenGL', '-framework', 'AGL', '-framework', 'AudioUnit', '-framework', 'CoreAudio', '-framework', 'CoreMIDI', '-lz', '-framework', 'IOKit', '-framework', 'ForceFeedback', '-framework', 'CoreVideo'])
env.Append(LIBS=['pthread'])
diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp
index 1a63d6ff75..89212b0e5e 100644
--- a/platform/osx/export/export.cpp
+++ b/platform/osx/export/export.cpp
@@ -441,7 +441,6 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
return ERR_FILE_NOT_FOUND;
}
- ERR_FAIL_COND_V(!src_pkg_zip, ERR_CANT_OPEN);
int ret = unzGoToFirstFile(src_pkg_zip);
String binary_to_use = "godot_osx_" + String(p_debug ? "debug" : "release") + ".64";
diff --git a/platform/server/detect.py b/platform/server/detect.py
index 5306a2bf69..08c2eb6aaf 100644
--- a/platform/server/detect.py
+++ b/platform/server/detect.py
@@ -201,7 +201,7 @@ def configure(env):
if not env['builtin_miniupnpc']:
# No pkgconfig file so far, hardcode default paths.
- env.Append(CPPPATH=["/usr/include/miniupnpc"])
+ env.Prepend(CPPPATH=["/usr/include/miniupnpc"])
env.Append(LIBS=["miniupnpc"])
# On Linux wchar_t should be 32-bits
@@ -215,7 +215,7 @@ def configure(env):
if not env['builtin_zlib']:
env.ParseConfig('pkg-config zlib --cflags --libs')
- env.Append(CPPPATH=['#platform/server'])
+ env.Prepend(CPPPATH=['#platform/server'])
env.Append(CPPFLAGS=['-DSERVER_ENABLED', '-DUNIX_ENABLED'])
if (platform.system() == "Darwin"):
diff --git a/platform/uwp/detect.py b/platform/uwp/detect.py
index 17f8242466..00f419f4f0 100644
--- a/platform/uwp/detect.py
+++ b/platform/uwp/detect.py
@@ -77,7 +77,7 @@ def configure(env):
# ANGLE
angle_root = os.getenv("ANGLE_SRC_PATH")
- env.Append(CPPPATH=[angle_root + '/include'])
+ env.Prepend(CPPPATH=[angle_root + '/include'])
jobs = str(env.GetOption("num_jobs"))
angle_build_cmd = "msbuild.exe " + angle_root + "/winrt/10/src/angle.sln /nologo /v:m /m:" + jobs + " /p:Configuration=Release /p:Platform="
@@ -137,7 +137,7 @@ def configure(env):
## Compile flags
- env.Append(CPPPATH=['#platform/uwp', '#drivers/windows'])
+ env.Prepend(CPPPATH=['#platform/uwp', '#drivers/windows'])
env.Append(CPPFLAGS=['/DUWP_ENABLED', '/DWINDOWS_ENABLED', '/DTYPED_METHOD_BIND'])
env.Append(CPPFLAGS=['/DGLES_ENABLED', '/DGL_GLEXT_PROTOTYPES', '/DEGL_EGLEXT_PROTOTYPES', '/DANGLE_ENABLED'])
winver = "0x0602" # Windows 8 is the minimum target for UWP build
diff --git a/platform/windows/detect.py b/platform/windows/detect.py
index 5c38eebf04..4b4b507499 100644
--- a/platform/windows/detect.py
+++ b/platform/windows/detect.py
@@ -201,7 +201,7 @@ def configure_msvc(env, manual_msvc_config):
env.AppendUnique(CXXFLAGS=['/TP']) # assume all sources are C++
if manual_msvc_config: # should be automatic if SCons found it
if os.getenv("WindowsSdkDir") is not None:
- env.Append(CPPPATH=[os.getenv("WindowsSdkDir") + "/Include"])
+ env.Prepend(CPPPATH=[os.getenv("WindowsSdkDir") + "/Include"])
else:
print("Missing environment variable: WindowsSdkDir")
@@ -239,7 +239,7 @@ def configure_msvc(env, manual_msvc_config):
env.AppendUnique(LINKFLAGS=['/LTCG'])
if manual_msvc_config:
- env.Append(CPPPATH=[p for p in os.getenv("INCLUDE").split(";")])
+ env.Prepend(CPPPATH=[p for p in os.getenv("INCLUDE").split(";")])
env.Append(LIBPATH=[p for p in os.getenv("LIB").split(";")])
# Incremental linking fix
@@ -342,7 +342,7 @@ def configure_mingw(env):
def configure(env):
# At this point the env has been set up with basic tools/compilers.
- env.Append(CPPPATH=['#platform/windows'])
+ env.Prepend(CPPPATH=['#platform/windows'])
print("Configuring for Windows: target=%s, bits=%s" % (env['target'], env['bits']))
diff --git a/platform/x11/crash_handler_x11.cpp b/platform/x11/crash_handler_x11.cpp
index 1e7f393bdd..44d3cf1910 100644
--- a/platform/x11/crash_handler_x11.cpp
+++ b/platform/x11/crash_handler_x11.cpp
@@ -96,12 +96,10 @@ static void handle_crash(int sig) {
String output = "";
// Try to get the file/line number using addr2line
- if (OS::get_singleton()) {
- int ret;
- Error err = OS::get_singleton()->execute(String("addr2line"), args, true, NULL, &output, &ret);
- if (err == OK) {
- output.erase(output.length() - 1, 1);
- }
+ int ret;
+ Error err = OS::get_singleton()->execute(String("addr2line"), args, true, NULL, &output, &ret);
+ if (err == OK) {
+ output.erase(output.length() - 1, 1);
}
fprintf(stderr, "[%ld] %s (%ls)\n", i, fname, output.c_str());
diff --git a/platform/x11/detect.py b/platform/x11/detect.py
index f8ae5e9acb..933ee6b72e 100644
--- a/platform/x11/detect.py
+++ b/platform/x11/detect.py
@@ -275,7 +275,7 @@ def configure(env):
if not env['builtin_miniupnpc']:
# No pkgconfig file so far, hardcode default paths.
- env.Append(CPPPATH=["/usr/include/miniupnpc"])
+ env.Prepend(CPPPATH=["/usr/include/miniupnpc"])
env.Append(LIBS=["miniupnpc"])
# On Linux wchar_t should be 32-bits
@@ -316,7 +316,7 @@ def configure(env):
if not env['builtin_zlib']:
env.ParseConfig('pkg-config zlib --cflags --libs')
- env.Append(CPPPATH=['#platform/x11'])
+ env.Prepend(CPPPATH=['#platform/x11'])
env.Append(CPPFLAGS=['-DX11_ENABLED', '-DUNIX_ENABLED', '-DOPENGL_ENABLED', '-DGLES_ENABLED'])
env.Append(LIBS=['GL', 'pthread'])
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 267ac08a72..d5ca3742db 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -503,35 +503,33 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
current_cursor = CURSOR_ARROW;
- if (cursor_theme) {
- for (int i = 0; i < CURSOR_MAX; i++) {
-
- static const char *cursor_file[] = {
- "left_ptr",
- "xterm",
- "hand2",
- "cross",
- "watch",
- "left_ptr_watch",
- "fleur",
- "hand1",
- "X_cursor",
- "sb_v_double_arrow",
- "sb_h_double_arrow",
- "size_bdiag",
- "size_fdiag",
- "hand1",
- "sb_v_double_arrow",
- "sb_h_double_arrow",
- "question_arrow"
- };
+ for (int i = 0; i < CURSOR_MAX; i++) {
- img[i] = XcursorLibraryLoadImage(cursor_file[i], cursor_theme, cursor_size);
- if (img[i]) {
- cursors[i] = XcursorImageLoadCursor(x11_display, img[i]);
- } else {
- print_verbose("Failed loading custom cursor: " + String(cursor_file[i]));
- }
+ static const char *cursor_file[] = {
+ "left_ptr",
+ "xterm",
+ "hand2",
+ "cross",
+ "watch",
+ "left_ptr_watch",
+ "fleur",
+ "hand1",
+ "X_cursor",
+ "sb_v_double_arrow",
+ "sb_h_double_arrow",
+ "size_bdiag",
+ "size_fdiag",
+ "hand1",
+ "sb_v_double_arrow",
+ "sb_h_double_arrow",
+ "question_arrow"
+ };
+
+ img[i] = XcursorLibraryLoadImage(cursor_file[i], cursor_theme, cursor_size);
+ if (img[i]) {
+ cursors[i] = XcursorImageLoadCursor(x11_display, img[i]);
+ } else {
+ print_verbose("Failed loading custom cursor: " + String(cursor_file[i]));
}
}
@@ -1192,9 +1190,12 @@ void OS_X11::set_window_position(const Point2 &p_position) {
unsigned long remaining;
unsigned char *data = NULL;
if (XGetWindowProperty(x11_display, x11_window, prop, 0, 4, False, AnyPropertyType, &type, &format, &len, &remaining, &data) == Success) {
- long *extents = (long *)data;
- x = extents[0];
- y = extents[2];
+ if (format == 32 && len == 4) {
+ long *extents = (long *)data;
+ x = extents[0];
+ y = extents[2];
+ }
+ XFree(data);
}
}
XMoveWindow(x11_display, x11_window, p_position.x - x, p_position.y - y);
@@ -1220,9 +1221,12 @@ Size2 OS_X11::get_real_window_size() const {
unsigned long remaining;
unsigned char *data = NULL;
if (XGetWindowProperty(x11_display, x11_window, prop, 0, 4, False, AnyPropertyType, &type, &format, &len, &remaining, &data) == Success) {
- long *extents = (long *)data;
- w += extents[0] + extents[1]; // left, right
- h += extents[2] + extents[3]; // top, bottom
+ if (format == 32 && len == 4) {
+ long *extents = (long *)data;
+ w += extents[0] + extents[1]; // left, right
+ h += extents[2] + extents[3]; // top, bottom
+ }
+ XFree(data);
}
return Size2(w, h);
}
diff --git a/platform/x11/power_x11.cpp b/platform/x11/power_x11.cpp
index 943c2b1383..50da6a4967 100644
--- a/platform/x11/power_x11.cpp
+++ b/platform/x11/power_x11.cpp
@@ -115,7 +115,7 @@ bool PowerX11::make_proc_acpi_key_val(char **_ptr, char **_key, char **_val) {
*(ptr++) = '\0'; /* terminate the key. */
- while ((*ptr == ' ') && (*ptr != '\0')) {
+ while (*ptr == ' ') {
ptr++; /* skip whitespace. */
}