mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 11:30:18 +00:00
set PK_ENABLE_OS
to 0 by default
This commit is contained in:
parent
74ffb3f6ed
commit
5ce5285d4b
@ -4,12 +4,12 @@ label: 'Advanced config'
|
|||||||
order: -2
|
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
|
```cpp
|
||||||
#define PK_ENABLE_OS 0
|
#define PK_ENABLE_OS 1
|
||||||
#include <pocketpy.h>
|
#include <pocketpy.h>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
// Whether to compile os-related modules or not
|
// Whether to compile os-related modules or not
|
||||||
#ifndef PK_ENABLE_OS // can be overrided by cmake
|
#ifndef PK_ENABLE_OS // can be overrided by cmake
|
||||||
#define PK_ENABLE_OS 1
|
#define PK_ENABLE_OS 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Enable this if you are working with multi-threading (experimental)
|
// Enable this if you are working with multi-threading (experimental)
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace pkpy{
|
namespace pkpy{
|
||||||
|
|
||||||
|
#if PK_ENABLE_OS
|
||||||
static FILE* io_fopen(const char* name, const char* mode){
|
static FILE* io_fopen(const char* name, const char* mode){
|
||||||
#if _MSC_VER
|
#if _MSC_VER
|
||||||
FILE* fp;
|
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);
|
return fread(buffer, size, count, fp);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
unsigned char* _default_import_handler(const char* name_p, int name_size, int* out_size){
|
unsigned char* _default_import_handler(const char* name_p, int name_size, int* out_size){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user