From 36cb92014dd7c08963014c3e1f6223be21378444 Mon Sep 17 00:00:00 2001 From: Hyotaek Shim Date: Mon, 25 Feb 2019 11:38:51 +0900 Subject: [PATCH] Apply the highest priority to constructors __attribute__((constructor(101))) Change-Id: Ic08c64eb9bae900c6be90c21074e64804e2fabc7 Signed-off-by: Hyotaek Shim --- src/internal/global_nodestruct.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/internal/global_nodestruct.hpp b/src/internal/global_nodestruct.hpp index 6bc7fe7..fc89577 100644 --- a/src/internal/global_nodestruct.hpp +++ b/src/internal/global_nodestruct.hpp @@ -28,7 +28,7 @@ namespace detail_NODESTRUCT_GLOBAL { alignas(TYPE) extern uint8_t NAME[sizeof(TYPE)]; }\ /* awkwardly written to silence gcc's -Wstrict-aliasing because _Pragma("GCC diagnostic ignored \"-Wstrict-aliasing\"") is bugged */\ static inline TYPE &NAME() { auto p = static_cast(&detail_NODESTRUCT_GLOBAL::NAME[0]); return *reinterpret_cast(p); }\ - namespace detailInit_NODESTRUCT_GLOBAL { __attribute__((constructor)) static void NAME() { new(&::NAME()) TYPE(); } } + namespace detailInit_NODESTRUCT_GLOBAL { __attribute__((constructor(101))) static void NAME() { new(&::NAME()) TYPE(); } } /** Define a global variable that is constructed (via gcc's __attribute__((constructor))) but never destroyed. */ #define DEF_NODESTRUCT_GLOBAL(TYPE,NAME)\ -- 2.7.4