This commit is contained in:
p.kosyh 2010-07-31 11:52:33 +00:00
parent 8456e686ee
commit e9323edc4d

View file

@ -50,11 +50,33 @@ static int setup_zip(const char *file, char *p)
}
#endif
#ifdef __APPLE__
#include <CoreFoundation/CoreFoundation.h>
void macosx_init(void) {
char resourcePath[PATH_MAX];
CFBundleRef mainBundle;
CFURLRef resourcesDirectoryURL;
mainBundle = CFBundleGetMainBundle();
if (!mainBundle)
return;
resourcesDirectoryURL = CFBundleCopyResourcesDirectoryURL(mainBundle);
if (!resourcesDirectoryURL)
return;
CFURLGetFileSystemRepresentation(resourcesDirectoryURL, true, (UInt8 *) resourcePath, PATH_MAX);
CFRelease(resourcesDirectoryURL);
chdir(resourcePath);
return;
}
#endif
int main(int argc, char *argv[])
{
int clean_tmp = 0;
int err = 0;
int i;
#ifdef __APPLE__
macosx_init();
#endif
#ifdef _USE_GTK
gtk_init(&argc, &argv);
#endif