From 72d071540ce5bc249ebd986596eb7c3db77e0bfb Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Fri, 14 Aug 2020 07:52:20 +0900 Subject: Rename `MRB_METHOD_T_STRUCT` to `MRB_USE_METHOD_T_STRUCT`. It's the first change of renaming configuration options to `MRB_XXX` to `MRB_USE_XXX` or `MRB_NO_XXX`. --- include/mrbconf.h | 8 ++++---- include/mruby.h | 2 +- include/mruby/proc.h | 5 +++-- 3 files changed, 8 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/mrbconf.h b/include/mrbconf.h index 3241346b2..734ec98e7 100644 --- a/include/mrbconf.h +++ b/include/mrbconf.h @@ -47,13 +47,13 @@ /* size of the method cache (need to be the power of 2) */ //#define MRB_METHOD_CACHE_SIZE (1<<8) -/* add -DMRB_METHOD_T_STRUCT on machines that use higher bits of pointers */ -/* no MRB_METHOD_T_STRUCT requires highest 2 bits of function pointers to be zero */ -#ifndef MRB_METHOD_T_STRUCT +/* add -DMRB_USE_METHOD_T_STRUCT on machines that use higher bits of function pointers */ +/* no MRB_USE_METHOD_T_STRUCT requires highest 2 bits of function pointers to be zero */ +#ifndef MRB_USE_METHOD_T_STRUCT // can't use highest 2 bits of function pointers at least on 32bit // Windows and 32bit Linux. # ifdef MRB_32BIT -# define MRB_METHOD_T_STRUCT +# define MRB_USE_METHOD_T_STRUCT # endif #endif diff --git a/include/mruby.h b/include/mruby.h index 9f1d1aa30..dea0a9c88 100644 --- a/include/mruby.h +++ b/include/mruby.h @@ -199,7 +199,7 @@ struct mrb_context { */ typedef mrb_value (*mrb_func_t)(struct mrb_state *mrb, mrb_value self); -#ifndef MRB_METHOD_T_STRUCT +#ifndef MRB_USE_METHOD_T_STRUCT typedef uintptr_t mrb_method_t; #else typedef struct { diff --git a/include/mruby/proc.h b/include/mruby/proc.h index fe0cf2eb0..c14c1ff9c 100644 --- a/include/mruby/proc.h +++ b/include/mruby/proc.h @@ -101,7 +101,8 @@ MRB_API mrb_value mrb_proc_cfunc_env_get(mrb_state *mrb, mrb_int idx); #define MRB_METHOD_FUNC_FL 1 #define MRB_METHOD_NOARG_FL 2 -#ifndef MRB_METHOD_T_STRUCT + +#ifndef MRB_USE_METHOD_T_STRUCT #define MRB_METHOD_FUNC_P(m) (((uintptr_t)(m))&MRB_METHOD_FUNC_FL) #define MRB_METHOD_NOARG_P(m) (((uintptr_t)(m))&MRB_METHOD_NOARG_FL) @@ -125,7 +126,7 @@ MRB_API mrb_value mrb_proc_cfunc_env_get(mrb_state *mrb, mrb_int idx); #define MRB_METHOD_PROC(m) ((m).proc) #define MRB_METHOD_UNDEF_P(m) ((m).proc==NULL) -#endif /* MRB_METHOD_T_STRUCT */ +#endif /* MRB_USE_METHOD_T_STRUCT */ #define MRB_METHOD_CFUNC_P(m) (MRB_METHOD_FUNC_P(m)?TRUE:(MRB_METHOD_PROC(m)?(MRB_PROC_CFUNC_P(MRB_METHOD_PROC(m))):FALSE)) #define MRB_METHOD_CFUNC(m) (MRB_METHOD_FUNC_P(m)?MRB_METHOD_FUNC(m):((MRB_METHOD_PROC(m)&&MRB_PROC_CFUNC_P(MRB_METHOD_PROC(m)))?MRB_PROC_CFUNC(MRB_METHOD_PROC(m)):NULL)) -- cgit v1.2.3