summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2019-12-29 16:55:16 +0100
committerHugo Locurcio <hugo.locurcio@hugo.pro>2019-12-29 16:56:22 +0100
commitd441a6aefadda78bb0bb02552716cbede38fe662 (patch)
treeb04181eef061d7829c02f7850e19d1bc5ea34ab2 /core
parent12482bf8840ce2fa84d6eea7999628be426cba8d (diff)
Print a warning message if `OS.exit_code` is set to a non-portable value
This also improves the related documentation.
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);
}