Skip to content

Commit 1dc8c77

Browse files
author
Tal Hadad
committed
fix: use #ifdef _UNICODE in windows
1 parent 1ff90af commit 1dc8c77

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

simplecpp.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2688,10 +2688,15 @@ static std::string currentDirectoryOSCalc() {
26882688
#ifdef SIMPLECPP_WINDOWS
26892689
TCHAR NPath[MAX_PATH];
26902690
GetCurrentDirectory(MAX_PATH, NPath);
2691+
#ifdef _UNICODE
26912692
// convert the result from TCHAR* to char*
26922693
char NPathA[MAX_PATH];
26932694
::WideCharToMultiByte(CP_ACP, 0, NPath, lstrlen(NPath), NPathA, MAX_PATH, NULL, NULL);
26942695
return NPathA;
2696+
#elif
2697+
// in this case, TCHAR* is just defined to be a char*
2698+
return NPath;
2699+
#endif
26952700
#else
26962701
const std::size_t size = 1024;
26972702
char the_path[size];

0 commit comments

Comments
 (0)