2 * LibSylph Class Library
3 * Copyright (C) 2009 Frank "SeySayux" Erens <seysayux@gmail.com>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the LibSylph Pulbic License as published
7 * by the LibSylph Developers; either version 1.0 of the License, or
8 * (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the LibSylph
13 * Public License for more details.
15 * You should have received a copy of the LibSylph Public License
16 * along with this Library, if not, contact the LibSylph Developers.
18 * Created on 17 januari 2009, 15:14
24 #include "Sylph/OS/OS.h"
25 #include "Sylph/Core/Application.h"
26 #include "Sylph/Core/Array.h"
27 #include "Sylph/Core/String.h"
28 #include "Sylph/Core/Common.h"
29 #include "Sylph/Core/AppType.h"
30 #include "Sylph/Core/UncaughtExceptionHandler.h"
32 #ifndef SYLPH_NO_SYLPHMAIN
33 #ifndef SYLPH_APP_NAME
34 #define SYLPH_APP_NAME "Application"
37 #ifdef SYLPH_OS_MACOSX
38 int main(int argc
, char * argv
[], char * envp
[], char * apple
[]);
40 int main(int argc
, char * argv
[]);
42 static inline void SylphInit(int argc
, char * argv
[], char * apple
[]) {
43 Sylph::Application::init(argc
, argv
, apple
, Sylph::SYLPH_APP_TYPE
,
46 extern int SylphMain(Sylph::Array
<Sylph::String
> argv
);
48 #ifdef SYLPH_OS_MACOSX
50 int main(int argc
, char * argv
[], char * envp
[], char * apple
[]) {
52 SylphInit(argc
, argv
, apple
);
53 Array
<String
> args(argc
);
54 for(int i
= 0; i
< argc
; ++i
) {
57 return SylphMain(args
);
58 } catch (Sylph::Exception
& ex
) {
59 Sylph::UncaughtExceptionHandler::handler
->handle(ex
);
64 int main(int argc
, char * argv
[]) {
66 SylphInit(argc
, argv
, Sylph::null
);
67 Array
<String
> args(argc
);
68 for(int i
= 0; i
< argc
; ++i
) {
71 return SylphMain(args
);
72 } catch (Sylph::Exception
& ex
) {
73 Sylph::UncaughtExceptionHandler::handler
->handle(ex
);