Apply the highest priority to constructors 17/200417/2
authorHyotaek Shim <hyotaek.shim@samsung.com>
Mon, 25 Feb 2019 02:38:51 +0000 (11:38 +0900)
committerHyotaek Shim <hyotaek.shim@samsung.com>
Mon, 25 Feb 2019 02:39:22 +0000 (11:39 +0900)
__attribute__((constructor(101)))

Change-Id: Ic08c64eb9bae900c6be90c21074e64804e2fabc7
Signed-off-by: Hyotaek Shim <hyotaek.shim@samsung.com>
src/internal/global_nodestruct.hpp

index 6bc7fe7..fc89577 100644 (file)
@@ -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<void*>(&detail_NODESTRUCT_GLOBAL::NAME[0]); return *reinterpret_cast<TYPE*>(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)\