2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8 /** @file unix_main.cpp Main entry for Mac OSX. */
10 #include "../../stdafx.h"
11 #include "../../openttd.h"
12 #include "../../crashlog.h"
13 #include "../../core/random_func.hpp"
14 #include "../../string_func.h"
21 #include "../../safeguards.h"
23 void CocoaSetupAutoreleasePool();
24 void CocoaReleaseAutoreleasePool();
26 int CDECL
main(int argc
, char *argv
[])
28 /* Make sure our arguments contain only valid UTF-8 characters. */
29 for (int i
= 0; i
< argc
; i
++) StrMakeValidInPlace(argv
[i
]);
31 CocoaSetupAutoreleasePool();
32 /* This is passed if we are launched by double-clicking */
33 if (argc
>= 2 && strncmp(argv
[1], "-psn", 4) == 0) {
38 CrashLog::InitialiseCrashLog();
40 SetRandomSeed(time(nullptr));
42 signal(SIGPIPE
, SIG_IGN
);
44 int ret
= openttd_main(std::span(argv
, argc
));
46 CocoaReleaseAutoreleasePool();