aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_interface
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2019-04-23 17:28:53 +0200
committerSverker Eriksson <[email protected]>2019-04-23 17:28:53 +0200
commita7120cd744bcb2d4fd4c3cf9211243153d5999cb (patch)
treea2639adeeac9ec43387c46e27c49ada133aa7efb /lib/erl_interface
parent053e4b191a5bf401bf4afb6787735a42b0dc6019 (diff)
downloadotp-a7120cd744bcb2d4fd4c3cf9211243153d5999cb.tar.gz
otp-a7120cd744bcb2d4fd4c3cf9211243153d5999cb.tar.bz2
otp-a7120cd744bcb2d4fd4c3cf9211243153d5999cb.zip
erl_interface: Fix C++ compile error
"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; ^
Diffstat (limited to 'lib/erl_interface')
-rw-r--r--lib/erl_interface/include/ei.h2
-rw-r--r--lib/erl_interface/src/decode/decode_fun.c12
-rw-r--r--lib/erl_interface/src/encode/encode_fun.c2
3 files changed, 8 insertions, 8 deletions
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;