Skip to content

Commit aae2bbb

Browse files
committed
Fix: deprecated function usage (globalcontext_insert_atom)
globalcontext_insert_atom is no longer on main, and thus unable to compile. Signed-off-by: Peter M <[email protected]>
1 parent b4c79d4 commit aae2bbb

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ports/atomvm_mqtt_client.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,12 @@ struct platform_data {
119119

120120
static term make_atom(GlobalContext *global, const char *string)
121121
{
122-
int global_atom_index = globalcontext_insert_atom(global, (AtomString) string);
123-
return term_from_atom_index(global_atom_index);
122+
term new_atom = globalcontext_make_atom(global, string);
123+
if (UNLIKELY(term_is_invalid_term(new_atom))) {
124+
RAISE_ERROR(OUT_OF_MEMORY_ATOM);
125+
}
126+
127+
return new_atom;
124128
}
125129

126130
static term heap_create_tuple4(Heap *heap, term a, term b, term c, term d)

0 commit comments

Comments
 (0)