Skip to content

Commit 2aa59b9

Browse files
committed
Use named constructor so multiple CHDeclareMethods can be used in a single line (via macro)
1 parent 967a38d commit 2aa59b9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

CaptainHook.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,8 @@ typedef struct CHClassDeclaration_ CHClassDeclaration_;
270270
// Declarative style methods (automatically calls CHHook)
271271
#define CHDeclareMethod_(return_type, class_type, class_name, class_val, name, sel, sigdef, supercall, args...) \
272272
static inline void $ ## class_name ## _ ## name ## _register(); \
273-
CHConstructor { \
273+
__attribute__((constructor)) \
274+
static inline void $ ## class_name ## _ ## name ## _constructor() { \
274275
CHLoadLateClass(class_name); \
275276
$ ## class_name ## _ ## name ## _register(); \
276277
} \

0 commit comments

Comments
 (0)