From aae2bbb36a873e2aea283ada39aa369bc5b39c45 Mon Sep 17 00:00:00 2001 From: Peter M Date: Fri, 31 Oct 2025 09:38:05 +0100 Subject: [PATCH] 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 --- ports/atomvm_mqtt_client.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ports/atomvm_mqtt_client.c b/ports/atomvm_mqtt_client.c index 9c21c30..d61540f 100644 --- a/ports/atomvm_mqtt_client.c +++ b/ports/atomvm_mqtt_client.c @@ -119,8 +119,12 @@ struct platform_data { static term make_atom(GlobalContext *global, const char *string) { - int global_atom_index = globalcontext_insert_atom(global, (AtomString) string); - return term_from_atom_index(global_atom_index); + term new_atom = globalcontext_make_atom(global, string); + if (UNLIKELY(term_is_invalid_term(new_atom))) { + RAISE_ERROR(OUT_OF_MEMORY_ATOM); + } + + return new_atom; } static term heap_create_tuple4(Heap *heap, term a, term b, term c, term d)