Skip to content

Commit

Permalink
Go back to return by value
Browse files Browse the repository at this point in the history
Revert "Fix definition of to_path"

This reverts commit e5c08bb.

Revert "try making to_path return a c str to make mingw happy"

This reverts commit f16137b.
  • Loading branch information
dschuff committed Aug 31, 2023
1 parent 478dfd5 commit 9fdb5df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/support/path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion src/support/path.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9fdb5df

Please sign in to comment.