minor fixes for MacOS
This commit is contained in:
parent
74fd2c8584
commit
9a084bca66
15
src/setup.c
15
src/setup.c
@ -85,12 +85,15 @@ char * Get_program_directory(const char * argv0)
|
||||
// MacOSX
|
||||
#if defined(__macosx__)
|
||||
program_dir = malloc(MAXPATHLEN);
|
||||
CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
|
||||
(void)argv0; // unused
|
||||
CFURLGetFileSystemRepresentation(url,true,(UInt8*)program_dir,MAXPATHLEN);
|
||||
CFRelease(url);
|
||||
// Append trailing slash
|
||||
strcat(program_dir ,"/");
|
||||
if (program_dir != NULL)
|
||||
{
|
||||
CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
|
||||
(void)argv0; // unused
|
||||
CFURLGetFileSystemRepresentation(url,true,(UInt8*)program_dir,MAXPATHLEN);
|
||||
CFRelease(url);
|
||||
// Append trailing slash
|
||||
strcat(program_dir ,"/");
|
||||
}
|
||||
|
||||
// AmigaOS and alike: hard-coded volume name.
|
||||
#elif defined(__amigaos4__) || defined(__AROS__) || defined(__MORPHOS__) || defined(__amigaos__)
|
||||
|
||||
@ -360,7 +360,7 @@ void Init_text(void)
|
||||
#elif defined(__macosx__)
|
||||
// Récupération de la liste des fonts avec fontconfig
|
||||
#ifndef NOTTF
|
||||
|
||||
{
|
||||
|
||||
int i,number;
|
||||
char * home_dir = NULL;
|
||||
@ -383,6 +383,7 @@ void Init_text(void)
|
||||
|
||||
free(home_dir);
|
||||
//CFRelease(url);
|
||||
}
|
||||
#endif
|
||||
|
||||
#elif defined(__CAANOO__) || defined(__WIZ__) || defined(__GP2X__)
|
||||
@ -805,4 +806,4 @@ byte *Render_text(const char *str, int font_number, int size, int antialias, int
|
||||
{
|
||||
return Render_text_SFont(str, font_number, width, height, palette);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user