From 9fdb5dfeca64d3d670446252ff13ea1cae8115cf Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Thu, 31 Aug 2023 16:27:24 -0700 Subject: [PATCH] Go back to return by value Revert "Fix definition of to_path" This reverts commit e5c08bbac0113c312c03f73f6f5fd0f0a15ae720. Revert "try making to_path return a c str to make mingw happy" This reverts commit f16137bde7fb4fee318d5add752859b67dc24c28. --- src/support/path.cpp | 4 ++-- src/support/path.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/support/path.cpp b/src/support/path.cpp index c9e3c2b8efc..a09e146e236 100644 --- a/src/support/path.cpp +++ b/src/support/path.cpp @@ -26,7 +26,7 @@ namespace wasm::Path { #ifdef _WIN32 -const PathString::value_type* to_path(const std::string& s) { return string_to_wstring(s); } +PathString to_path(const std::string& s) { return string_to_wstring(s); } std::wstring string_to_wstring(const std::string& s) { const char* inptr = s.data(); @@ -49,7 +49,7 @@ std::string wstring_to_string(const std::wstring& s) { return outstr; } #else -const PathString::value_type* to_path(const std::string& s) { return s.c_str(); } +PathString to_path(const std::string& s) { return s; } #endif char getPathSeparator() { diff --git a/src/support/path.h b/src/support/path.h index dc7d340b6ce..b0ca34a7cec 100644 --- a/src/support/path.h +++ b/src/support/path.h @@ -34,7 +34,7 @@ std::string wstring_to_string(const std::wstring& s); using PathString = std::string; #endif -const PathString::value_type* to_path(const std::string& s); +PathString to_path(const std::string& s); char getPathSeparator(); std::string getDirName(const std::string& path);