From d441a6aefadda78bb0bb02552716cbede38fe662 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sun, 29 Dec 2019 16:55:16 +0100 Subject: Print a warning message if `OS.exit_code` is set to a non-portable value This also improves the related documentation. --- core/bind/core_bind.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core/bind') 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); } -- cgit v1.2.3