all repos — mgba @ 71995f77d5e004e5d03f6fc06c0fdb77fe03cf98

mGBA Game Boy Advance Emulator

Core: Add support for Haiku's config directory
Crestwave crest.wave@yahoo.com
Sun, 01 Mar 2020 09:50:32 +0800
commit

71995f77d5e004e5d03f6fc06c0fdb77fe03cf98

parent

cf45add3fbcfb4aa0b88515947f769807d3314e3

1 files changed, 10 insertions(+), 0 deletions(-)

jump to
M src/core/config.csrc/core/config.c

@@ -27,6 +27,10 @@ #ifdef _3DS

#include <mgba-util/platform/3ds/3ds-vfs.h> #endif +#ifdef __HAIKU__ +#include <FindDirectory.h> +#endif + #define SECTION_NAME_MAX 128 struct mCoreConfigEnumerateData {

@@ -227,6 +231,12 @@ #elif defined(_3DS)

UNUSED(portable); snprintf(out, outLength, "/%s", projectName); FSUSER_CreateDirectory(sdmcArchive, fsMakePath(PATH_ASCII, out), 0); +#elif defined(__HAIKU__) + UNUSED(portable); + char path[B_PATH_NAME_LENGTH]; + find_directory(B_USER_SETTINGS_DIRECTORY, 0, false, path, B_PATH_NAME_LENGTH); + snprintf(out, outLength, "%s/%s", path, binaryName); + mkdir(out, 0755); #else getcwd(out, outLength); strncat(out, PATH_SEP "portable.ini", outLength - strlen(out));