Skip to content

term_from_resource: fix C++ compat#2364

Merged
bettio merged 1 commit into
atomvm:release-0.7from
pguyot:w28/fix-cpp-compat
Jul 23, 2026
Merged

term_from_resource: fix C++ compat#2364
bettio merged 1 commit into
atomvm:release-0.7from
pguyot:w28/fix-cpp-compat

Conversation

@pguyot

@pguyot pguyot commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

term_from_resource is a static inline in term.h and can be reached from C++ translation units, but refc_binary_add_refcount relies on C11 <stdatomic.h>, which C++ does not support. Use the extern "C" refc_binary_increment_refcount helper instead.

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later

term_from_resource is a static inline in term.h and can be reached from
C++ translation units, but refc_binary_add_refcount relies on C11
<stdatomic.h>, which C++ does not support. Use the extern "C"
refc_binary_increment_refcount helper instead.

Signed-off-by: Paul Guyot <pguyot@kallisys.net>
@pguyot
pguyot force-pushed the w28/fix-cpp-compat branch from 1e31a7b to 45377e0 Compare July 20, 2026 19:47
@bettio
bettio merged commit 1ef0ef6 into atomvm:release-0.7 Jul 23, 2026
188 of 189 checks passed
@pguyot
pguyot deleted the w28/fix-cpp-compat branch July 23, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants