comment for the trick to enable constructors in static lib & fix coding style

This commit is contained in:
Nguyen Anh Quynh 2014-01-09 14:33:56 +08:00
parent e94bf7272e
commit 625b5bcfee

4
cs.c
View File

@ -14,13 +14,15 @@ cs_err (*arch_init[MAX_ARCH])(cs_struct *) = { NULL };
cs_err (*arch_option[MAX_ARCH]) (cs_struct *, cs_opt_type, size_t value) = { NULL }; cs_err (*arch_option[MAX_ARCH]) (cs_struct *, cs_opt_type, size_t value) = { NULL };
void (*arch_destroy[MAX_ARCH]) (cs_struct *) = { NULL }; void (*arch_destroy[MAX_ARCH]) (cs_struct *) = { NULL };
// we need this trick to enable module constructors in static lib
extern void enable_arm(); extern void enable_arm();
extern void enable_arm64(); extern void enable_arm64();
extern void enable_mips(); extern void enable_mips();
extern void enable_x86(); extern void enable_x86();
extern void enable_powerpc(); extern void enable_powerpc();
void enable_construct() { void enable_construct()
{
#ifdef CAPSTONE_HAS_ARM #ifdef CAPSTONE_HAS_ARM
enable_arm(); enable_arm();
#endif #endif