summaryrefslogtreecommitdiffstats
path: root/platform/ios/godot_ios.mm
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-03-06 18:50:35 +0100
committerRémi Verschelde <rverschelde@gmail.com>2024-03-08 23:31:24 +0100
commit023dcd44c1e628bb654b5472418d6a346b510a71 (patch)
tree61ae1291ab2b93c2a0de25c4edcc11ee20c3be75 /platform/ios/godot_ios.mm
parentffc41fb76df5922321cdd98cce12715a039629b0 (diff)
downloadredot-engine-023dcd44c1e628bb654b5472418d6a346b510a71.tar.gz
Refactor OS exit code to be `EXIT_SUCCESS` by default
- `Main::setup` early exits (failure or `--help`/`--version`) now consistently return `EXIT_FAILURE` or `EXIT_SUCCESS` on all platforms, instead of 255 on some and a Godot Error code on others. - `Main::start` now returns the exit code, simplifying the handling of early failures. - `Main::iteration` needs to explicit set the exit code in OS if it errors out. - Web and iOS now properly return `OS::get_exit_code()` instead of 0.
Diffstat (limited to 'platform/ios/godot_ios.mm')
-rw-r--r--platform/ios/godot_ios.mm11
1 files changed, 6 insertions, 5 deletions
diff --git a/platform/ios/godot_ios.mm b/platform/ios/godot_ios.mm
index 5e66c8b47b..9d35d43344 100644
--- a/platform/ios/godot_ios.mm
+++ b/platform/ios/godot_ios.mm
@@ -102,15 +102,16 @@ int ios_main(int argc, char **argv) {
Error err = Main::setup(fargv[0], argc - 1, &fargv[1], false);
- if (err == ERR_HELP) { // Returned by --help and --version, so success.
- return 0;
- } else if (err != OK) {
- return 255;
+ if (err != OK) {
+ if (err == ERR_HELP) { // Returned by --help and --version, so success.
+ return EXIT_SUCCESS;
+ }
+ return EXIT_FAILURE;
}
os->initialize_modules();
- return 0;
+ return os->get_exit_code();
}
void ios_finish() {