macOS: Have the support directory be in Application support.
This commit is contained in:
parent
366529ca35
commit
4ebf9ec427
1 changed files with 16 additions and 0 deletions
|
|
@ -50,6 +50,8 @@
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#undef pause
|
#undef pause
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern void creatediscimage_open(void *hwnd);
|
extern void creatediscimage_open(void *hwnd);
|
||||||
|
|
@ -241,6 +243,20 @@ void get_pcem_path(char *s, int size)
|
||||||
#ifdef __linux
|
#ifdef __linux
|
||||||
wx_get_home_directory(s);
|
wx_get_home_directory(s);
|
||||||
strcat(s, ".pcem/");
|
strcat(s, ".pcem/");
|
||||||
|
#elif defined(__APPLE__)
|
||||||
|
/*TODO: Use CoreFoundation functions to get proper directory, in case
|
||||||
|
the Application Support directory is different (I.E., with signing)*/
|
||||||
|
wx_get_home_directory(s);
|
||||||
|
strcat(s, "Library/Application Support/PCem/");
|
||||||
|
|
||||||
|
struct stat st = {0};
|
||||||
|
|
||||||
|
// create ~/Library/Application Support/PCem/
|
||||||
|
// if it doesn't exist
|
||||||
|
if (stat(s, &st) == -1)
|
||||||
|
{
|
||||||
|
mkdir(s, 0700);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
char* path = SDL_GetBasePath();
|
char* path = SDL_GetBasePath();
|
||||||
strcpy(s, path);
|
strcpy(s, path);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue