blueloveTH 1 year ago
parent
commit
aa3be3b63d
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/modules/os.c

+ 2 - 2
src/modules/os.c

@@ -5,14 +5,14 @@
 #include "pocketpy/common/sstream.h"
 #include "pocketpy/interpreter/vm.h"
 
-#if _WIN32
+#if PY_SYS_PLATFORM == 0
 #include <direct.h>
 
 int platform_chdir(const char* path) { return _chdir(path); }
 
 bool platform_getcwd(char* buf, size_t size) { return _getcwd(buf, size) != NULL; }
 
-#elif __linux__
+#elif PY_SYS_PLATFORM == 3 || PY_SYS_PLATFORM == 5
 #include <unistd.h>
 
 int platform_chdir(const char* path) { return chdir(path); }