]> git.tdb.fi Git - libs/core.git/blob - source/core/unix/main.cpp
OS X tweaks
[libs/core.git] / source / core / unix / main.cpp
1 #include "application.h"
2
3 int main(int argc, char **argv)
4 {
5         void *data = 0;
6
7 #ifdef __APPLE__
8         /* Applications launched from Finder get a special argument, which would
9         interfere with GetOpt.  Remove it from argv but pass it as data so it can
10         be used to determine how the application was launhed. */
11         int j = 0;
12         for(int i=0; i<argc; ++i)
13         {
14                 if(!strncmp(argv[i], "-psn_", 5))
15                         data = argv[i];
16                 else
17                         argv[j++] = argv[i];
18         }
19         argc = j;
20         argv[j] = 0;
21 #endif
22
23         return Msp::Application::run(argc, argv, data);
24 }