From 26c397aa046cac0c308ecc7245f3ffd64b951bcb Mon Sep 17 00:00:00 2001 From: Paul Lietar Date: Mon, 15 Jan 2024 11:12:16 +0000 Subject: [PATCH] Add missing `inline` attributes to avoid linker issues. The `xoshiro<2>::do_jump` specializations need some `inline` attribute, otherwise including dqrng from multiple compilation units causes linker errors due to symbols being defined multiple times. --- inst/include/xoshiro.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inst/include/xoshiro.h b/inst/include/xoshiro.h index d03e7f9..debf9ce 100644 --- a/inst/include/xoshiro.h +++ b/inst/include/xoshiro.h @@ -104,7 +104,7 @@ class xoshiro { }; template<> -void xoshiro<2>::do_jump(std::array JUMP) { +inline void xoshiro<2>::do_jump(std::array JUMP) { uint64_t s0 = 0; uint64_t s1 = 0; for(unsigned int i = 0; i < sizeof JUMP / sizeof JUMP.begin(); i++) @@ -121,7 +121,7 @@ void xoshiro<2>::do_jump(std::array JUMP) { } template<> -void xoshiro<4>::do_jump(std::array JUMP) { +inline void xoshiro<4>::do_jump(std::array JUMP) { uint64_t s0 = 0; uint64_t s1 = 0; uint64_t s2 = 0;