diff --git a/src/api/l_filesystem.c b/src/api/l_filesystem.c index e1d0845d..1d787edf 100644 --- a/src/api/l_filesystem.c +++ b/src/api/l_filesystem.c @@ -7,12 +7,6 @@ #include #include -#ifdef _WIN32 -const char lovrDirSep = '\\'; -#else -const char lovrDirSep = '/'; -#endif - void* luax_readfile(const char* filename, size_t* bytesRead) { return lovrFilesystemRead(filename, -1, bytesRead); } @@ -434,7 +428,7 @@ static int libLoader(lua_State* L) { luaL_Buffer buffer; luaL_buffinit(L, &buffer); luaL_addstring(&buffer, lovrFilesystemGetRealDirectory(filename)); - luaL_addchar(&buffer, lovrDirSep); + luaL_addchar(&buffer, LOVR_PATH_SEP); luaL_addstring(&buffer, filename); luaL_pushresult(&buffer); @@ -461,7 +455,7 @@ static int libLoader(lua_State* L) { } } else if (*p == '?') { for (const char* m = module; n && *m; n--, m++) { - *f++ = *m == '.' ? lovrDirSep : *m; + *f++ = *m == '.' ? LOVR_PATH_SEP : *m; } p++; diff --git a/src/modules/filesystem/filesystem.h b/src/modules/filesystem/filesystem.h index a4475aa7..bd15ed26 100644 --- a/src/modules/filesystem/filesystem.h +++ b/src/modules/filesystem/filesystem.h @@ -6,7 +6,11 @@ #define LOVR_PATH_MAX 1024 -extern const char lovrDirSep; +#ifdef _WIN32 +#define LOVR_PATH_SEP '\\' +#else +#define LOVR_PATH_SEP '/' +#endif bool lovrFilesystemInit(const char* argExe, const char* argGame, const char* argRoot); void lovrFilesystemDestroy(void); diff --git a/src/modules/headset/openvr.c b/src/modules/headset/openvr.c index 8f8bb2e2..558b43c7 100644 --- a/src/modules/headset/openvr.c +++ b/src/modules/headset/openvr.c @@ -107,7 +107,7 @@ static bool openvr_init(float offset, uint32_t msaa) { } char path[LOVR_PATH_MAX]; - snprintf(path, sizeof(path), "%s%cactions.json", lovrFilesystemGetSaveDirectory(), lovrDirSep); + snprintf(path, sizeof(path), "%s%cactions.json", lovrFilesystemGetSaveDirectory(), LOVR_PATH_SEP); state.input->SetActionManifestPath(path); state.input->GetActionSetHandle("/actions/lovr", &state.actionSet);