mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-21 12:00:18 +00:00
add PK_ENABLE_CUSTOM_SNAME
This commit is contained in:
parent
8fe2e4457f
commit
c0d5f1e575
@ -53,6 +53,11 @@ if(PK_ENABLE_WATCHDOG)
|
|||||||
add_definitions(-DPK_ENABLE_WATCHDOG=1)
|
add_definitions(-DPK_ENABLE_WATCHDOG=1)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(PK_ENABLE_CUSTOM_SNAME)
|
||||||
|
add_definitions(-DPK_ENABLE_CUSTOM_SNAME=1)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if(PK_BUILD_MODULE_LZ4)
|
if(PK_BUILD_MODULE_LZ4)
|
||||||
add_subdirectory(3rd/lz4)
|
add_subdirectory(3rd/lz4)
|
||||||
add_definitions(-DPK_BUILD_MODULE_LZ4)
|
add_definitions(-DPK_BUILD_MODULE_LZ4)
|
||||||
|
@ -9,6 +9,7 @@ endif()
|
|||||||
option(PK_ENABLE_OS "" OFF)
|
option(PK_ENABLE_OS "" OFF)
|
||||||
option(PK_ENABLE_DETERMINISM "" OFF)
|
option(PK_ENABLE_DETERMINISM "" OFF)
|
||||||
option(PK_ENABLE_WATCHDOG "" OFF)
|
option(PK_ENABLE_WATCHDOG "" OFF)
|
||||||
|
option(PK_ENABLE_CUSTOM_SNAME "" OFF)
|
||||||
|
|
||||||
# modules
|
# modules
|
||||||
option(PK_BUILD_MODULE_LZ4 "" OFF)
|
option(PK_BUILD_MODULE_LZ4 "" OFF)
|
||||||
|
@ -8,3 +8,8 @@ void pk_names_finalize();
|
|||||||
#define MAGIC_METHOD(x) extern py_Name x;
|
#define MAGIC_METHOD(x) extern py_Name x;
|
||||||
#include "pocketpy/xmacros/magics.h"
|
#include "pocketpy/xmacros/magics.h"
|
||||||
#undef MAGIC_METHOD
|
#undef MAGIC_METHOD
|
||||||
|
|
||||||
|
py_Name py_namev(c11_sv name);
|
||||||
|
c11_sv py_name2sv(py_Name index);
|
||||||
|
py_Name py_name(const char* name);
|
||||||
|
const char* py_name2str(py_Name index);
|
@ -20,6 +20,10 @@
|
|||||||
#define PK_ENABLE_WATCHDOG 0
|
#define PK_ENABLE_WATCHDOG 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef PK_ENABLE_CUSTOM_SNAME // can be overridden by cmake
|
||||||
|
#define PK_ENABLE_CUSTOM_SNAME 0
|
||||||
|
#endif
|
||||||
|
|
||||||
// GC min threshold
|
// GC min threshold
|
||||||
#ifndef PK_GC_MIN_THRESHOLD // can be overridden by cmake
|
#ifndef PK_GC_MIN_THRESHOLD // can be overridden by cmake
|
||||||
#define PK_GC_MIN_THRESHOLD 32768
|
#define PK_GC_MIN_THRESHOLD 32768
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#if PK_ENABLE_CUSTOM_SNAME == 0
|
||||||
|
|
||||||
#include "pocketpy/common/name.h"
|
#include "pocketpy/common/name.h"
|
||||||
#include "pocketpy/common/str.h"
|
#include "pocketpy/common/str.h"
|
||||||
#include "pocketpy/pocketpy.h"
|
#include "pocketpy/pocketpy.h"
|
||||||
@ -95,3 +97,5 @@ const char* py_name2str(py_Name index) {
|
|||||||
NameBucket* p = (NameBucket*)index;
|
NameBucket* p = (NameBucket*)index;
|
||||||
return p->data;
|
return p->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
Loading…
x
Reference in New Issue
Block a user