From 617ff4fc77d0f470a30436f32a294f2514e27427 Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Fri, 24 May 2024 23:08:37 +0800 Subject: [PATCH] some fix --- include/pocketpy/common.h | 4 ---- include/pocketpy/config.h | 4 ++-- include/pocketpy/obj.h | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/include/pocketpy/common.h b/include/pocketpy/common.h index 0405a8b4..6bf29c51 100644 --- a/include/pocketpy/common.h +++ b/include/pocketpy/common.h @@ -38,10 +38,6 @@ #undef max #endif -/*******************************************************************************/ -#if PK_ENABLE_STD_FUNCTION -#include -#endif /*******************************************************************************/ #if PK_ENABLE_THREAD diff --git a/include/pocketpy/config.h b/include/pocketpy/config.h index 24e30f7a..2da9bfd7 100644 --- a/include/pocketpy/config.h +++ b/include/pocketpy/config.h @@ -23,11 +23,11 @@ #define PK_GC_MIN_THRESHOLD 16384 #endif -// Whether to use `std::function` to do bindings or not +// Whether to use `pkpy::function<>` to do bindings or not // By default, functions to be binded must be a C function pointer without capture // However, someone thinks it's not convenient. // By setting this to 1, capturing lambdas can be binded, -// but it's slower and may cause severe "code bloat", also needs more time to compile. +// but it's slower and may cause "code bloat", it also needs more time to compile. #define PK_ENABLE_STD_FUNCTION 0 /*************** debug settings ***************/ diff --git a/include/pocketpy/obj.h b/include/pocketpy/obj.h index 77c5f6d4..c3488ae4 100644 --- a/include/pocketpy/obj.h +++ b/include/pocketpy/obj.h @@ -7,7 +7,7 @@ namespace pkpy { #if PK_ENABLE_STD_FUNCTION -using NativeFuncC = std::function; +using NativeFuncC = function; #else typedef PyVar (*NativeFuncC)(VM*, ArgsView); #endif