diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | array.c | 3 | ||||
-rw-r--r-- | awk.h | 14 | ||||
-rwxr-xr-x | configure | 4 | ||||
-rw-r--r-- | configure.ac | 4 |
5 files changed, 28 insertions, 5 deletions
@@ -22,6 +22,14 @@ * awkgram.y (isnoeffect): Add ifdefs around declaration, use, and function body. + Unrelated: Restore building with tcc. + + * awk.h (AFUNC): Move to array.c which is the only place its used. + (ainit_ind, atypeof_ind, etc.): New macros for use in array.c + * array.c (AFUNC): Change to use F##_ind. Works with tcc and other + compilers. + * configure.ac: Only add -export-dynamic flag if compiling with gcc. + 2012-12-18 Andrew J. Schorr <aschorr@telemetry-investments.com> * gawkapi.c (sym_update_real): If setting a scalar variable that exists @@ -53,6 +53,9 @@ static afunc_t null_array_func[] = { static afunc_t *array_types[MAX_ATYPE]; static int num_array_types = 0; +/* array func to index mapping */ +#define AFUNC(F) (F ## _ind) + /* register_array_func --- add routines to handle arrays */ int @@ -508,21 +508,29 @@ typedef struct exp_node { #define parent_array sub.nodep.x.extra #define ainit array_funcs[0] +#define ainit_ind 0 #define atypeof array_funcs[1] +#define atypeof_ind 1 #define alength array_funcs[2] +#define alength_ind 2 #define alookup array_funcs[3] +#define alookup_ind 3 #define aexists array_funcs[4] +#define aexists_ind 4 #define aclear array_funcs[5] +#define aclear_ind 5 #define aremove array_funcs[6] +#define aremove_ind 6 #define alist array_funcs[7] +#define alist_ind 7 #define acopy array_funcs[8] +#define acopy_ind 8 #define adump array_funcs[9] +#define adump_ind 9 #define astore array_funcs[10] +#define astore_ind 10 #define NUM_AFUNCS 11 /* # of entries in array_funcs */ -/* array func to index mapping */ -#define AFUNC(F) (& ((NODE *) 0)->F - ((NODE *) 0)->array_funcs) - /* Node_array_ref: */ #define orig_array lnode #define prev_array rnode @@ -10086,7 +10086,9 @@ fi $as_echo "#define DYNAMIC 1" >>confdefs.h - if uname | $EGREP -i 'linux|freebsd' > /dev/null + # Add -export-dynamic for old extensions. Only works for GCC + if test "$GCC" = yes && + uname | $EGREP -i 'linux|freebsd' > /dev/null then LDFLAGS="$LDFLAGS -export-dynamic" fi diff --git a/configure.ac b/configure.ac index bccd2351..fef29e06 100644 --- a/configure.ac +++ b/configure.ac @@ -295,7 +295,9 @@ AC_CHECK_HEADER(dlfcn.h, if test "$gawk_have_dlopen" = yes then AC_DEFINE([DYNAMIC], 1, [dynamic loading is possible]) - if uname | $EGREP -i 'linux|freebsd' > /dev/null + # Add -export-dynamic for old extensions. Only works for GCC + if test "$GCC" = yes && + uname | $EGREP -i 'linux|freebsd' > /dev/null then LDFLAGS="$LDFLAGS -export-dynamic" fi |