blueloveTH 1 年之前
父节点
当前提交
aa3be3b63d
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/modules/os.c

+ 2 - 2
src/modules/os.c

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