diff --git a/docs/quick-start/config.md b/docs/quick-start/config.md index e4bcd73c..18c4b117 100644 --- a/docs/quick-start/config.md +++ b/docs/quick-start/config.md @@ -4,12 +4,12 @@ label: 'Advanced config' order: -2 --- -### Disable os-related features +### Enable os-related features -If you want to disable os-related features, you can do this before including `pocketpy.h`. +If you want to enable os-related features, you can do this before including `pocketpy.h`. ```cpp -#define PK_ENABLE_OS 0 +#define PK_ENABLE_OS 1 #include ``` diff --git a/include/pocketpy/config.h b/include/pocketpy/config.h index 9dc16339..c04d292f 100644 --- a/include/pocketpy/config.h +++ b/include/pocketpy/config.h @@ -10,7 +10,7 @@ // Whether to compile os-related modules or not #ifndef PK_ENABLE_OS // can be overrided by cmake -#define PK_ENABLE_OS 1 +#define PK_ENABLE_OS 0 #endif // Enable this if you are working with multi-threading (experimental) diff --git a/src/io.cpp b/src/io.cpp index 3d83acdb..13be5671 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -2,6 +2,7 @@ namespace pkpy{ +#if PK_ENABLE_OS static FILE* io_fopen(const char* name, const char* mode){ #if _MSC_VER FILE* fp; @@ -20,6 +21,7 @@ static size_t io_fread(void* buffer, size_t size, size_t count, FILE* fp){ return fread(buffer, size, count, fp); #endif } +#endif unsigned char* _default_import_handler(const char* name_p, int name_size, int* out_size){