summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/linuxbsd/detect.py1
-rw-r--r--platform/linuxbsd/display_server_x11.cpp11
-rw-r--r--platform/linuxbsd/godot_linuxbsd.cpp10
-rw-r--r--platform/osx/detect.py1
-rw-r--r--platform/osx/godot_main_osx.mm10
5 files changed, 31 insertions, 2 deletions
diff --git a/platform/linuxbsd/detect.py b/platform/linuxbsd/detect.py
index 03c85d09ad..f3a6004356 100644
--- a/platform/linuxbsd/detect.py
+++ b/platform/linuxbsd/detect.py
@@ -162,6 +162,7 @@ def configure(env):
if env["use_ubsan"] or env["use_asan"] or env["use_lsan"] or env["use_tsan"] or env["use_msan"]:
env.extra_suffix += ".san"
+ env.Append(CCFLAGS=["-DSANITIZERS_ENABLED"])
if env["use_ubsan"]:
env.Append(
diff --git a/platform/linuxbsd/display_server_x11.cpp b/platform/linuxbsd/display_server_x11.cpp
index 2ddccdb8bf..8fa8c64efe 100644
--- a/platform/linuxbsd/display_server_x11.cpp
+++ b/platform/linuxbsd/display_server_x11.cpp
@@ -1732,8 +1732,15 @@ bool DisplayServerX11::_window_maximize_check(WindowID p_window, const char *p_a
if (result == Success && data) {
Atom *atoms = (Atom *)data;
- Atom wm_act_max_horz = XInternAtom(x11_display, "_NET_WM_ACTION_MAXIMIZE_HORZ", False);
- Atom wm_act_max_vert = XInternAtom(x11_display, "_NET_WM_ACTION_MAXIMIZE_VERT", False);
+ Atom wm_act_max_horz;
+ Atom wm_act_max_vert;
+ if (strcmp(p_atom_name, "_NET_WM_STATE") == 0) {
+ wm_act_max_horz = XInternAtom(x11_display, "_NET_WM_STATE_MAXIMIZED_HORZ", False);
+ wm_act_max_vert = XInternAtom(x11_display, "_NET_WM_STATE_MAXIMIZED_VERT", False);
+ } else {
+ wm_act_max_horz = XInternAtom(x11_display, "_NET_WM_ACTION_MAXIMIZE_HORZ", False);
+ wm_act_max_vert = XInternAtom(x11_display, "_NET_WM_ACTION_MAXIMIZE_VERT", False);
+ }
bool found_wm_act_max_horz = false;
bool found_wm_act_max_vert = false;
diff --git a/platform/linuxbsd/godot_linuxbsd.cpp b/platform/linuxbsd/godot_linuxbsd.cpp
index 7c9f81bd3f..9fe00568fb 100644
--- a/platform/linuxbsd/godot_linuxbsd.cpp
+++ b/platform/linuxbsd/godot_linuxbsd.cpp
@@ -33,10 +33,20 @@
#include <stdlib.h>
#include <unistd.h>
+#if defined(SANITIZERS_ENABLED)
+#include <sys/resource.h>
+#endif
+
#include "main/main.h"
#include "os_linuxbsd.h"
int main(int argc, char *argv[]) {
+#if defined(SANITIZERS_ENABLED)
+ // Note: Set stack size to be at least 30 MB (vs 8 MB default) to avoid overflow, address sanitizer can increase stack usage up to 3 times.
+ struct rlimit stack_lim = { 0x1E00000, 0x1E00000 };
+ setrlimit(RLIMIT_STACK, &stack_lim);
+#endif
+
OS_LinuxBSD os;
setlocale(LC_CTYPE, "");
diff --git a/platform/osx/detect.py b/platform/osx/detect.py
index 0ff93bedb4..8d848d2094 100644
--- a/platform/osx/detect.py
+++ b/platform/osx/detect.py
@@ -127,6 +127,7 @@ def configure(env):
if env["use_ubsan"] or env["use_asan"] or env["use_tsan"]:
env.extra_suffix += ".san"
+ env.Append(CCFLAGS=["-DSANITIZERS_ENABLED"])
if env["use_ubsan"]:
env.Append(
diff --git a/platform/osx/godot_main_osx.mm b/platform/osx/godot_main_osx.mm
index f3db363151..053a7f4a1d 100644
--- a/platform/osx/godot_main_osx.mm
+++ b/platform/osx/godot_main_osx.mm
@@ -35,12 +35,22 @@
#include <string.h>
#include <unistd.h>
+#if defined(SANITIZERS_ENABLED)
+#include <sys/resource.h>
+#endif
+
int main(int argc, char **argv) {
#if defined(VULKAN_ENABLED)
// MoltenVK - enable full component swizzling support.
setenv("MVK_CONFIG_FULL_IMAGE_VIEW_SWIZZLE", "1", 1);
#endif
+#if defined(SANITIZERS_ENABLED)
+ // Note: Set stack size to be at least 30 MB (vs 8 MB default) to avoid overflow, address sanitizer can increase stack usage up to 3 times.
+ struct rlimit stack_lim = { 0x1E00000, 0x1E00000 };
+ setrlimit(RLIMIT_STACK, &stack_lim);
+#endif
+
int first_arg = 1;
const char *dbg_arg = "-NSDocumentRevisionsDebugMode";
printf("arguments\n");