chdir() => Change_directory()

improve portability
This commit is contained in:
Thomas Bernard
2018-02-12 11:34:38 +01:00
parent 62944c724e
commit a1f0f36062
6 changed files with 22 additions and 14 deletions

View File

@@ -540,3 +540,12 @@ const char * Get_current_directory(char * buf, size_t size)
return getcwd(buf, size);
#endif
}
int Change_directory(const char * path)
{
#if defined(__WIN32__) || defined(WIN32)
return (SetCurrentDirectoryA(path) ? 0 : -1);
#else
return chdir(path);
#endif
}