From bbe9adae884c1c2cc7687c74b9d3722f1f7f61e7 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 17 Sep 2017 20:34:19 +0300 Subject: Fix gawkapi.h to be usable with C++. --- gawkapi.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'gawkapi.h') diff --git a/gawkapi.h b/gawkapi.h index 66bd85d3..93ec5c1f 100644 --- a/gawkapi.h +++ b/gawkapi.h @@ -493,7 +493,7 @@ typedef struct gawk_api { * function itself receives this pointer and can modify what it * points to, thus it's not const. */ - awk_bool_t (*api_add_ext_func)(awk_ext_id_t id, const char *namespace, + awk_bool_t (*api_add_ext_func)(awk_ext_id_t id, const char *name_space, awk_ext_func_t *func); /* Register an input parser; for opening files read-only */ @@ -984,11 +984,11 @@ r_make_string(const gawk_api_t *api, /* needed for emalloc */ return r_make_string_type(api, ext_id, string, length, duplicate, result, AWK_STRING); } -#define make_const_string(str, len, result) r_make_string(api, ext_id, str, len, 1, result) -#define make_malloced_string(str, len, result) r_make_string(api, ext_id, str, len, 0, result) +#define make_const_string(str, len, result) r_make_string(api, ext_id, str, len, awk_true, result) +#define make_malloced_string(str, len, result) r_make_string(api, ext_id, str, len, awk_false, result) -#define make_const_regex(str, len, result) r_make_string_type(api, ext_id, str, len, 1, result, AWK_REGEX) -#define make_malloced_regex(str, len, result) r_make_string_type(api, ext_id, str, len, 0, result, AWK_REGEX) +#define make_const_regex(str, len, result) r_make_string_type(api, ext_id, str, len, awk_true, result, AWK_REGEX) +#define make_malloced_regex(str, len, result) r_make_string_type(api, ext_id, str, len, awk_false, result, AWK_REGEX) /* * Note: The caller may not create a STRNUM, but it can create a string that is @@ -1104,7 +1104,7 @@ int dl_load(const gawk_api_t *const api_p, awk_ext_id_t id) \ int errors = 0; \ \ api = api_p; \ - ext_id = id; \ + ext_id = (void **) id; \ \ if (api->major_version != GAWK_API_MAJOR_VERSION \ || api->minor_version < GAWK_API_MINOR_VERSION) { \ -- cgit v1.2.3