From 8a0ecc0e324680026bdc9c1ca704f1291ac7ee60 Mon Sep 17 00:00:00 2001 From: Avril Date: Sun, 7 Nov 2021 19:47:54 +0000 Subject: [PATCH] XXX: Why is sm64"s dynctor not being called? MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fortune for rngxx's current commit: Great blessing − 大吉 --- src/init.cpp | 2 +- src/rng/sm64.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/init.cpp b/src/init.cpp index a550006..6e565ae 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -12,7 +12,7 @@ namespace rng::init const std::function& apply_raw(std::string_view name, std::function fn) noexcept { if(!INIT_MAP) INIT_MAP = new ctor_map(); - + auto& map = *INIT_MAP; map[name] = std::move(fn); return map[name]; diff --git a/src/rng/sm64.cpp b/src/rng/sm64.cpp index 7600bab..5d4b493 100644 --- a/src/rng/sm64.cpp +++ b/src/rng/sm64.cpp @@ -3,4 +3,5 @@ #include +__attribute__((used)) RNGXX_APPLY_CTOR(rng, sm64, u64);