Skip to content

Instantly share code, notes, and snippets.

@myfreeer
Last active June 13, 2017 13:25
Show Gist options
  • Save myfreeer/cc7377306ac7809592e310412f2f17a6 to your computer and use it in GitHub Desktop.
Save myfreeer/cc7377306ac7809592e310412f2f17a6 to your computer and use it in GitHub Desktop.
#include <windows.h>
wchar_t *getCurrentDirW(void)
{
static wchar_t buffer[MAX_PATH];
GetCurrentDirectoryW(MAX_PATH, buffer);
return buffer;
}
char *getCurrentDirA(void)
{
static char buffer[MAX_PATH];
GetCurrentDirectoryA(MAX_PATH, buffer);
return buffer;
}
#ifdef UNICODE
#define getCurrentDir getCurrentDirW
#else
#define getCurrentDir getCurrentDirA
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment