From 538fdd51a7e530adf2ab31a76deb9ac8e52f525e Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Mon, 24 Oct 2022 23:45:53 +0200 Subject: Fix in cbox/carc. --- include/stc/carc.h | 5 +++++ include/stc/cbox.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/include/stc/carc.h b/include/stc/carc.h index e061aa2c..91de0931 100644 --- a/include/stc/carc.h +++ b/include/stc/carc.h @@ -149,8 +149,13 @@ STC_INLINE void _cx_memb(_reset_to)(_cx_self* self, _cx_value* p) { *self = _cx_memb(_from_ptr)(p); } +#ifndef _i_no_emplace STC_INLINE _cx_self _cx_memb(_new)(_cx_raw raw) { return _cx_memb(_from)(i_keyfrom(raw)); } +#else +STC_INLINE _cx_self _cx_memb(_new)(_cx_value val) + { return _cx_memb(_from)(val); } +#endif // does not use i_keyclone, so OK to always define. STC_INLINE _cx_self _cx_memb(_clone)(_cx_self ptr) { diff --git a/include/stc/cbox.h b/include/stc/cbox.h index dc7b76ba..cb8b7069 100644 --- a/include/stc/cbox.h +++ b/include/stc/cbox.h @@ -128,8 +128,13 @@ STC_INLINE void _cx_memb(_reset_to)(_cx_self* self, _cx_value* p) { self->get = p; } +#ifndef _i_no_emplace STC_INLINE _cx_self _cx_memb(_new)(_cx_raw raw) { return _cx_memb(_from)(i_keyfrom(raw)); } +#else +STC_INLINE _cx_self _cx_memb(_new)(_cx_value val) + { return _cx_memb(_from)(val); } +#endif #if !defined _i_no_clone STC_INLINE _cx_self _cx_memb(_clone)(_cx_self other) { -- cgit v1.2.3