diff options
Diffstat (limited to 'src/osd/modules/file/posixdir.cpp')
-rw-r--r-- | src/osd/modules/file/posixdir.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/osd/modules/file/posixdir.cpp b/src/osd/modules/file/posixdir.cpp index 2a755a513fe..282a58acfc9 100644 --- a/src/osd/modules/file/posixdir.cpp +++ b/src/osd/modules/file/posixdir.cpp @@ -22,7 +22,7 @@ #endif #endif -#ifdef WIN32 +#ifdef _WIN32 #define _FILE_OFFSET_BITS 64 #endif @@ -40,6 +40,7 @@ #define _DARWIN_C_SOURCE // to get DT_xxx on OS X #include "osdcore.h" +#include "osdfile.h" #include "modules/lib/osdlib.h" #include "util/strformat.h" @@ -62,13 +63,13 @@ namespace { // CONSTANTS //============================================================ -#if defined(WIN32) +#if defined(_WIN32) constexpr char PATHSEPCH = '\\'; #else constexpr char PATHSEPCH = '/'; #endif -#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__) || defined(__EMSCRIPTEN__) || defined(__ANDROID__) || defined(WIN32) || defined(SDLMAME_NO64BITIO) +#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__) || defined(__EMSCRIPTEN__) || defined(__ANDROID__) || defined(_WIN32) || defined(SDLMAME_NO64BITIO) using sdl_dirent = struct dirent; using sdl_stat = struct stat; #define sdl_readdir readdir @@ -192,7 +193,7 @@ bool posix_directory::open_impl(std::string const &dirname) { assert(!m_fd); - osd_subst_env(m_path, dirname); + m_path = dirname; m_fd.reset(::opendir(m_path.c_str())); return bool(m_fd); } @@ -223,7 +224,7 @@ directory::ptr directory::open(std::string const &dirname) // osd_subst_env //============================================================ -void osd_subst_env(std::string &dst, std::string const &src) +std::string osd_subst_env(std::string_view src) { std::string result, var; auto start = src.begin(); @@ -291,5 +292,5 @@ void osd_subst_env(std::string &dst, std::string const &src) } } - dst = std::move(result); + return result; } |