From: DJ Delorie Date: Thu, 15 Nov 2001 19:06:06 +0000 (+0000) Subject: merge from gcc X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dc5790516edcfb5c1a1e92208c59d637391601ef;p=binutils-gdb.git merge from gcc --- diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 3b72a0cf460..933cc38c646 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,15 @@ +Thu Nov 15 11:06:25 2001 Jeffrey A Law (law@cygnus.com) + + * config.in (HAVE_UINTPTR_T): Provide autoconf stub. + * configure.in (HAVE_UINTPTR_T): Test for system defining + uintptr_t and define HAVE_UINTPTR_T appropriately. + * regex.c (uintptr_t): Do not provide a definition if the + system provided one. + + * regex.c (PREFIX): Provide an alternate definition for + non-ANSI/ISO compilers. + (ARG_PREFIX): Likewise. + 2001-11-12 Jim Meyering * obstack.c (_): Honor the setting of ENABLE_NLS. Otherwise, diff --git a/libiberty/config.in b/libiberty/config.in index fa23f18c209..67042c0f431 100644 --- a/libiberty/config.in +++ b/libiberty/config.in @@ -30,6 +30,9 @@ /* Define vfork as fork if vfork does not work. */ #undef vfork +/* Define if the system defines a uintptr_t type. */ +#undef HAVE_UINTPTR_T + /* Define if you have the asprintf function. */ #undef HAVE_ASPRINTF diff --git a/libiberty/configure b/libiberty/configure index 4d8872fb135..d7bd75c4d5e 100755 --- a/libiberty/configure +++ b/libiberty/configure @@ -1427,6 +1427,35 @@ EOF fi +echo $ac_n "checking for uintptr_t""... $ac_c" 1>&6 +echo "configure:1432: checking for uintptr_t" >&5 +cat > conftest.$ac_ext < +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "uintptr_t" >/dev/null 2>&1; then + rm -rf conftest* + libiberty_cv_uintptr_t=yes +else + rm -rf conftest* + libiberty_cv_uintptr_t=no +fi +rm -f conftest* + + +if test $libiberty_cv_uintptr_t = yes +then + cat >> confdefs.h <<\EOF +#define HAVE_UINTPTR_T 1 +EOF + + echo "$ac_t""yes" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + # This is the list of functions which libiberty will provide if they # are not available on the host. @@ -1484,12 +1513,12 @@ if test "x" = "y"; then for ac_func in asprintf atexit basename bcmp bcopy bsearch bzero calloc clock do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1488: checking for $ac_func" >&5 +echo "configure:1517: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1539,12 +1568,12 @@ done for ac_func in getcwd getpagesize index insque mkstemps memchr memcmp memcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1543: checking for $ac_func" >&5 +echo "configure:1572: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1600: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1594,12 +1623,12 @@ done for ac_func in memmove memset putenv random rename rindex sigsetmask do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1598: checking for $ac_func" >&5 +echo "configure:1627: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1655: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1649,12 +1678,12 @@ done for ac_func in strcasecmp setenv strchr strdup strncasecmp strrchr strstr do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1653: checking for $ac_func" >&5 +echo "configure:1682: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1710: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1704,12 +1733,12 @@ done for ac_func in strtod strtol strtoul tmpnam vasprintf vfprintf vprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1708: checking for $ac_func" >&5 +echo "configure:1737: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1759,12 +1788,12 @@ done for ac_func in vsprintf waitpid getrusage on_exit psignal strerror strsignal do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1763: checking for $ac_func" >&5 +echo "configure:1792: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1814,12 +1843,12 @@ done for ac_func in sysconf times sbrk gettimeofday ffs do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1818: checking for $ac_func" >&5 +echo "configure:1847: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1875: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2039,7 +2068,7 @@ if test -z "${setobjs}"; then # We haven't set the list of objects yet. Use the standard autoconf # tests. This will only work if the compiler works. echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:2043: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2072: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -2050,12 +2079,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 2054 "configure" +#line 2083 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:2059: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2088: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -2081,19 +2110,19 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:2085: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2114: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross for ac_func in $funcs do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2092: checking for $ac_func" >&5 +echo "configure:2121: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2143,12 +2172,12 @@ done echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:2147: checking whether alloca needs Cray hooks" >&5 +echo "configure:2176: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2177: checking for $ac_func" >&5 +echo "configure:2206: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2227,7 +2256,7 @@ fi fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:2231: checking stack direction for C alloca" >&5 +echo "configure:2260: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2235,7 +2264,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2287: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -2275,12 +2304,12 @@ EOF echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2279: checking for ANSI C header files" >&5 +echo "configure:2308: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2288,7 +2317,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2292: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2321: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2305,7 +2334,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2323,7 +2352,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2344,7 +2373,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2355,7 +2384,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2388: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2379,12 +2408,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:2383: checking for pid_t" >&5 +echo "configure:2412: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -2413,17 +2442,17 @@ fi ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for vfork.h""... $ac_c" 1>&6 -echo "configure:2417: checking for vfork.h" >&5 +echo "configure:2446: checking for vfork.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2427: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2456: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2448,18 +2477,18 @@ else fi echo $ac_n "checking for working vfork""... $ac_c" 1>&6 -echo "configure:2452: checking for working vfork" >&5 +echo "configure:2481: checking for working vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$cross_compiling" = yes; then echo $ac_n "checking for vfork""... $ac_c" 1>&6 -echo "configure:2458: checking for vfork" >&5 +echo "configure:2487: checking for vfork" >&5 if eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_vfork=yes" else @@ -2504,7 +2533,7 @@ fi ac_cv_func_vfork_works=$ac_cv_func_vfork else cat > conftest.$ac_ext < @@ -2599,7 +2628,7 @@ main() { } } EOF -if { (eval echo configure:2603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_vfork_works=yes else @@ -2626,19 +2655,19 @@ fi fi for v in $vars; do echo $ac_n "checking for $v""... $ac_c" 1>&6 -echo "configure:2630: checking for $v" >&5 +echo "configure:2659: checking for $v" >&5 if eval "test \"`echo '$''{'libiberty_cv_var_$v'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "libiberty_cv_var_$v=yes" else @@ -2664,12 +2693,12 @@ EOF for ac_func in $checkfuncs do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2668: checking for $ac_func" >&5 +echo "configure:2697: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2718,21 +2747,21 @@ done fi -for ac_hdr in unistd.h +for ac_hdr in stdlib.h unistd.h sys/stat.h sys/types.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2726: checking for $ac_hdr" >&5 +echo "configure:2755: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2736: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2765: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2761,12 +2790,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2765: checking for $ac_func" >&5 +echo "configure:2794: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2814,7 +2843,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:2818: checking for working mmap" >&5 +echo "configure:2847: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2822,7 +2851,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext < #include +#if HAVE_SYS_TYPES_H +# include +#endif + +#if HAVE_STDLIB_H +# include +#endif + +#if HAVE_SYS_STAT_H +# include +#endif + +#if HAVE_UNISTD_H +# include +#endif + /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE -# ifdef HAVE_UNISTD_H -# include -# endif /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H @@ -2962,7 +3004,7 @@ main() } EOF -if { (eval echo configure:2966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -2986,7 +3028,7 @@ fi echo $ac_n "checking for working strncmp""... $ac_c" 1>&6 -echo "configure:2990: checking for working strncmp" >&5 +echo "configure:3032: checking for working strncmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_strncmp_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2994,7 +3036,7 @@ else ac_cv_func_strncmp_works=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_strncmp_works=yes else diff --git a/libiberty/configure.in b/libiberty/configure.in index 505b520ba87..7fc4856e606 100644 --- a/libiberty/configure.in +++ b/libiberty/configure.in @@ -126,6 +126,18 @@ AC_HEADER_TIME libiberty_AC_DECLARE_ERRNO +AC_MSG_CHECKING(for uintptr_t) +AC_EGREP_HEADER(uintptr_t, sys/types.h, + libiberty_cv_uintptr_t=yes, libiberty_cv_uintptr_t=no) + +if test $libiberty_cv_uintptr_t = yes +then + AC_DEFINE(HAVE_UINTPTR_T) + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + # This is the list of functions which libiberty will provide if they # are not available on the host. diff --git a/libiberty/regex.c b/libiberty/regex.c index 2852e849fa8..5ead8b642d6 100644 --- a/libiberty/regex.c +++ b/libiberty/regex.c @@ -301,7 +301,7 @@ init_syntax_once () # endif /* emacs */ /* Integer type for pointers. */ -# if !defined _LIBC +# if !defined _LIBC && !defined HAVE_UINTPTR_T typedef unsigned long int uintptr_t; # endif @@ -612,7 +612,11 @@ typedef enum # define UCHAR_T unsigned char # define COMPILED_BUFFER_VAR bufp->buffer # define OFFSET_ADDRESS_SIZE 2 -# define PREFIX(name) byte_##name +# if defined __STDC__ && __STDC__ +# define PREFIX(name) byte_##name +# else +# define PREFIX(name) byte_/**/name +# endif # define ARG_PREFIX(name) name # define PUT_CHAR(c) putchar (c) #else @@ -622,8 +626,13 @@ typedef enum # define COMPILED_BUFFER_VAR wc_buffer # define OFFSET_ADDRESS_SIZE 1 /* the size which STORE_NUMBER macro use */ # define CHAR_CLASS_SIZE ((__alignof__(wctype_t)+sizeof(wctype_t))/sizeof(CHAR_T)+1) -# define PREFIX(name) wcs_##name -# define ARG_PREFIX(name) c##name +# if defined __STDC__ && __STDC__ +# define PREFIX(name) wcs_##name +# define ARG_PREFIX(name) c##name +# else +# define PREFIX(name) wcs_/**/name +# define ARG_PREFIX(name) c/**/name +# endif /* Should we use wide stream?? */ # define PUT_CHAR(c) printf ("%C", c); # define TRUE 1