Method names can be pointers, so gcc actually merges them as constants...
This commit is contained in:
parent
3b03b0267f
commit
15b25cd634
@ -64,12 +64,12 @@
|
|||||||
#define FUNC_NAME(klass, name) _ ## klass ## _ ## name
|
#define FUNC_NAME(klass, name) _ ## klass ## _ ## name
|
||||||
#define FUNC_SIG(klass, name) _noexport KrkValue FUNC_NAME(klass,name) (int argc, KrkValue argv[], int hasKw)
|
#define FUNC_SIG(klass, name) _noexport KrkValue FUNC_NAME(klass,name) (int argc, KrkValue argv[], int hasKw)
|
||||||
#define KRK_METHOD(klass, name, body) FUNC_SIG(klass, name) { \
|
#define KRK_METHOD(klass, name, body) FUNC_SIG(klass, name) { \
|
||||||
static __attribute__ ((unused)) const char _method_name[] = # name; \
|
static __attribute__ ((unused)) const char* _method_name = # name; \
|
||||||
CHECK_ARG(0,klass,CURRENT_CTYPE,CURRENT_NAME); \
|
CHECK_ARG(0,klass,CURRENT_CTYPE,CURRENT_NAME); \
|
||||||
body; return NONE_VAL(); }
|
body; return NONE_VAL(); }
|
||||||
|
|
||||||
#define KRK_FUNC(name,body) static KrkValue _krk_ ## name (int argc, KrkValue argv[], int hasKw) { \
|
#define KRK_FUNC(name,body) static KrkValue _krk_ ## name (int argc, KrkValue argv[], int hasKw) { \
|
||||||
static __attribute__ ((unused)) const char _method_name[] = # name; \
|
static __attribute__ ((unused)) const char* _method_name = # name; \
|
||||||
body; return NONE_VAL(); }
|
body; return NONE_VAL(); }
|
||||||
|
|
||||||
/* This assumes you have a KrkInstance called `module` in the current scope. */
|
/* This assumes you have a KrkInstance called `module` in the current scope. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user