fix __attribute__((constructor)) position
Some checks failed
linux-x64-gcc / linux-gcc (Debug) (push) Failing after 57s
linux-mips64-gcc / linux-gcc-mips64el (Release) (push) Failing after 1m19s
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (push) Failing after 1m59s
linux-mips64-gcc / linux-gcc-mips64el (Debug) (push) Failing after 1m56s
linux-x64-gcc / linux-gcc (Release) (push) Failing after 1m53s
linux-arm-gcc / linux-gcc-armhf (push) Failing after 2m15s
Some checks failed
linux-x64-gcc / linux-gcc (Debug) (push) Failing after 57s
linux-mips64-gcc / linux-gcc-mips64el (Release) (push) Failing after 1m19s
linux-aarch64-cpu-gcc / linux-gcc-aarch64 (push) Failing after 1m59s
linux-mips64-gcc / linux-gcc-mips64el (Debug) (push) Failing after 1m56s
linux-x64-gcc / linux-gcc (Release) (push) Failing after 1m53s
linux-arm-gcc / linux-gcc-armhf (push) Failing after 2m15s
This commit is contained in:
parent
4fcbba126a
commit
2c07bea7cb
@ -61,13 +61,14 @@ private:
|
|||||||
|
|
||||||
#define REGISTER_MODULE_INITIALIZER(name, body) \
|
#define REGISTER_MODULE_INITIALIZER(name, body) \
|
||||||
namespace { \
|
namespace { \
|
||||||
__attribute__((constructor)) static void google_init_module_##name() { body; } \
|
static void google_init_module_##name() { body; } \
|
||||||
GoogleInitializer google_initializer_module_##name(#name, google_init_module_##name, NULL); \
|
GoogleInitializer google_initializer_module_##name(#name, google_init_module_##name, NULL); \
|
||||||
|
__attribute__((constructor)) static void EnsureConstructorRunsBeforeMain() { google_init_module_##name().name(); } \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define REGISTER_MODULE_DESTRUCTOR(name, body) \
|
#define REGISTER_MODULE_DESTRUCTOR(name, body) \
|
||||||
namespace { \
|
namespace { \
|
||||||
__attribute__((constructor)) static void google_destruct_module_##name() { body; } \
|
static void google_destruct_module_##name() { body; } \
|
||||||
GoogleInitializer google_destructor_module_##name(#name, NULL, google_destruct_module_##name); \
|
GoogleInitializer google_destructor_module_##name(#name, NULL, google_destruct_module_##name); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user