summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-12-30 18:09:32 +0100
committerGitHub <noreply@github.com>2019-12-30 18:09:32 +0100
commitccedda9c7126bd964186b6469f1558219436a71c (patch)
tree7dabce891a0caf000ff81beb4916fdd95ee4c2c5 /core
parent86a732b1364d7f198aa538118ce20d2972f13f7f (diff)
parentd441a6aefadda78bb0bb02552716cbede38fe662 (diff)
downloadredot-engine-ccedda9c7126bd964186b6469f1558219436a71c.tar.gz
Merge pull request #34682 from Calinou/os-exit-code-nonportable-warning
Print a warning message if `OS.exit_code` is set to a non-portable value
Diffstat (limited to 'core')
-rw-r--r--core/bind/core_bind.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp
index 4c8dcc20ea..25a67af342 100644
--- a/core/bind/core_bind.cpp
+++ b/core/bind/core_bind.cpp
@@ -686,6 +686,10 @@ int _OS::get_exit_code() const {
void _OS::set_exit_code(int p_code) {
+ if (p_code < 0 || p_code > 125) {
+ WARN_PRINT("For portability reasons, the exit code should be set between 0 and 125 (inclusive).");
+ }
+
OS::get_singleton()->set_exit_code(p_code);
}