From a7120cd744bcb2d4fd4c3cf9211243153d5999cb Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Tue, 23 Apr 2019 17:28:53 +0200 Subject: erl_interface: Fix C++ compile error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "export" is a reserved C++ keyword. lib/erl_interface/include/ei.h:290:9: error: expected ‘;’ after struct definition } export; ^ lib/erl_interface/include/ei.h:290:11: error: expected unqualified-id before ‘export’ } export; ^ --- lib/erl_interface/include/ei.h | 2 +- lib/erl_interface/src/decode/decode_fun.c | 12 ++++++------ lib/erl_interface/src/encode/encode_fun.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/erl_interface') diff --git a/lib/erl_interface/include/ei.h b/lib/erl_interface/include/ei.h index 591367dc95..a860df3f77 100644 --- a/lib/erl_interface/include/ei.h +++ b/lib/erl_interface/include/ei.h @@ -287,7 +287,7 @@ typedef struct { struct { char* func; int func_allocated; - } export; + } exprt; } u; } erlang_fun; diff --git a/lib/erl_interface/src/decode/decode_fun.c b/lib/erl_interface/src/decode/decode_fun.c index 32a950433e..3a7a2b01c1 100644 --- a/lib/erl_interface/src/decode/decode_fun.c +++ b/lib/erl_interface/src/decode/decode_fun.c @@ -153,8 +153,8 @@ int ei_decode_fun(const char *buf, int *index, erlang_fun *p) /* try use module buffer for function name */ used = strlen(p->module) + 1; p_func = p->module + used; - p->u.export.func = p_func; - p->u.export.func_allocated = 0; + p->u.exprt.func = p_func; + p->u.exprt.func_allocated = 0; } else { used = 0; @@ -165,8 +165,8 @@ int ei_decode_fun(const char *buf, int *index, erlang_fun *p) if (!used) return -1; p_func = malloc(MAXATOMLEN_UTF8); - p->u.export.func = p_func; - p->u.export.func_allocated = 1; + p->u.exprt.func = p_func; + p->u.exprt.func_allocated = 1; used = 0; } if (ei_decode_long(s, &ix, p_arity) < 0) @@ -186,8 +186,8 @@ void free_fun(erlang_fun* f) ei_free(f->u.closure.free_vars); break; case EI_FUN_EXPORT: - if (f->u.export.func_allocated) - ei_free(f->u.export.func); + if (f->u.exprt.func_allocated) + ei_free(f->u.exprt.func); break; } } diff --git a/lib/erl_interface/src/encode/encode_fun.c b/lib/erl_interface/src/encode/encode_fun.c index 38ba7c5b30..e29424f9f4 100644 --- a/lib/erl_interface/src/encode/encode_fun.c +++ b/lib/erl_interface/src/encode/encode_fun.c @@ -87,7 +87,7 @@ int ei_encode_fun(char *buf, int *index, const erlang_fun *p) ix++; if (ei_encode_atom_as(buf, &ix, p->module, ERLANG_UTF8, ERLANG_UTF8) < 0) return -1; - if (ei_encode_atom_as(buf, &ix, p->u.export.func, ERLANG_UTF8, ERLANG_UTF8) < 0) + if (ei_encode_atom_as(buf, &ix, p->u.exprt.func, ERLANG_UTF8, ERLANG_UTF8) < 0) return -1; if (ei_encode_long(buf, &ix, p->arity) < 0) return -1; -- cgit v1.2.3