From 5d208d402d04dd608ae9e638304a6a35d1050cd8 Mon Sep 17 00:00:00 2001 From: ivmai Date: Sat, 11 Sep 2010 11:27:06 +0000 Subject: [PATCH] 2010-09-11 Ivan Maidanski (really Ludovic Courtes) * configure.ac: Use `AC_C_INLINE'. * include/private/gc_priv.h (GC_INLINE): Use "inline" keyword (determined by configure AC_C_INLINE) if HAVE_CONFIG_H is defined. * configure.ac: Expand all tabs to spaces. * configure: Regenerate. * include/private/config.h.in: Ditto. --- ChangeLog | 9 ++ configure | 257 ++++++++++++++++++------------- configure.ac | 297 ++++++++++++++++++------------------ include/private/config.h.in | 6 + include/private/gc_priv.h | 5 +- 5 files changed, 319 insertions(+), 255 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5eb7bdc5..33862c9d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2010-09-11 Ivan Maidanski (really Ludovic Courtes) + + * configure.ac: Use `AC_C_INLINE'. + * include/private/gc_priv.h (GC_INLINE): Use "inline" keyword + (determined by configure AC_C_INLINE) if HAVE_CONFIG_H is defined. + * configure.ac: Expand all tabs to spaces. + * configure: Regenerate. + * include/private/config.h.in: Ditto. + 2010-09-11 Ivan Maidanski * dyn_load.c (DL_ITERATE_PHDR_STRONG): New macro (define for diff --git a/configure b/configure index d70be321..c3fad5d2 100755 --- a/configure +++ b/configure @@ -4920,8 +4920,8 @@ fi if test "${enable_parallel_mark+set}" = set; then : enableval=$enable_parallel_mark; case "$THREADS" in no | none | single) - as_fn_error $? "Parallel mark requires --enable-threads=x spec" "$LINENO" 5 - ;; + as_fn_error $? "Parallel mark requires --enable-threads=x spec" "$LINENO" 5 + ;; esac fi @@ -4952,6 +4952,50 @@ fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if test "${ac_cv_c_inline+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac THREADDLLIBS= @@ -4966,56 +5010,56 @@ case "$THREADS" in THREADDLLIBS=-lpthread case "$host" in x86-*-linux* | ia64-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* | alpha-*-linux* | sparc*-*-linux*) - $as_echo "#define GC_LINUX_THREADS 1" >>confdefs.h + $as_echo "#define GC_LINUX_THREADS 1" >>confdefs.h - $as_echo "#define _REENTRANT 1" >>confdefs.h + $as_echo "#define _REENTRANT 1" >>confdefs.h if test "${enable_parallel_mark}" = yes; then - $as_echo "#define PARALLEL_MARK 1" >>confdefs.h + $as_echo "#define PARALLEL_MARK 1" >>confdefs.h - fi - $as_echo "#define THREAD_LOCAL_ALLOC 1" >>confdefs.h + fi + $as_echo "#define THREAD_LOCAL_ALLOC 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"Explicit GC_INIT() calls may be required.\"" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"Explicit GC_INIT() calls may be required.\"" >&5 $as_echo "$as_me: WARNING: \"Explicit GC_INIT() calls may be required.\"" >&2;}; - ;; + ;; *-*-linux*) - $as_echo "#define GC_LINUX_THREADS 1" >>confdefs.h + $as_echo "#define GC_LINUX_THREADS 1" >>confdefs.h - $as_echo "#define _REENTRANT 1" >>confdefs.h + $as_echo "#define _REENTRANT 1" >>confdefs.h - ;; + ;; *-*-aix*) - $as_echo "#define GC_AIX_THREADS 1" >>confdefs.h + $as_echo "#define GC_AIX_THREADS 1" >>confdefs.h - $as_echo "#define _REENTRANT 1" >>confdefs.h + $as_echo "#define _REENTRANT 1" >>confdefs.h - ;; + ;; *-*-hpux11*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"Only HP/UX 11 POSIX threads are supported.\"" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"Only HP/UX 11 POSIX threads are supported.\"" >&5 $as_echo "$as_me: WARNING: \"Only HP/UX 11 POSIX threads are supported.\"" >&2;} - $as_echo "#define GC_HPUX_THREADS 1" >>confdefs.h + $as_echo "#define GC_HPUX_THREADS 1" >>confdefs.h - $as_echo "#define _POSIX_C_SOURCE 199506L" >>confdefs.h + $as_echo "#define _POSIX_C_SOURCE 199506L" >>confdefs.h - if test "${enable_parallel_mark}" = yes; then - $as_echo "#define PARALLEL_MARK 1" >>confdefs.h + if test "${enable_parallel_mark}" = yes; then + $as_echo "#define PARALLEL_MARK 1" >>confdefs.h - fi - $as_echo "#define THREAD_LOCAL_ALLOC 1" >>confdefs.h + fi + $as_echo "#define THREAD_LOCAL_ALLOC 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"Explicit GC_INIT() calls may be required.\"" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"Explicit GC_INIT() calls may be required.\"" >&5 $as_echo "$as_me: WARNING: \"Explicit GC_INIT() calls may be required.\"" >&2;}; - THREADDLLIBS="-lpthread -lrt" - # HPUX needs REENTRANT for the _r calls. + THREADDLLIBS="-lpthread -lrt" + # HPUX needs REENTRANT for the _r calls. $as_echo "#define _REENTRANT 1" >>confdefs.h - ;; + ;; *-*-hpux10*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"Only HP-UX 11 POSIX threads are supported.\"" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"Only HP-UX 11 POSIX threads are supported.\"" >&5 $as_echo "$as_me: WARNING: \"Only HP-UX 11 POSIX threads are supported.\"" >&2;} - ;; + ;; *-*-openbsd*) $as_echo "#define GC_OPENBSD_THREADS 1" >>confdefs.h @@ -5024,108 +5068,108 @@ $as_echo "$as_me: WARNING: \"Only HP-UX 11 POSIX threads are supported.\"" >&2;} openbsd_threads=true ;; *-*-freebsd*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"FreeBSD does not yet fully support threads with Boehm GC.\"" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"FreeBSD does not yet fully support threads with Boehm GC.\"" >&5 $as_echo "$as_me: WARNING: \"FreeBSD does not yet fully support threads with Boehm GC.\"" >&2;} - $as_echo "#define GC_FREEBSD_THREADS 1" >>confdefs.h + $as_echo "#define GC_FREEBSD_THREADS 1" >>confdefs.h - INCLUDES="$INCLUDES -pthread" - ;; + INCLUDES="$INCLUDES -pthread" + ;; *-*-kfreebsd*-gnu) - $as_echo "#define GC_FREEBSD_THREADS 1" >>confdefs.h + $as_echo "#define GC_FREEBSD_THREADS 1" >>confdefs.h - INCLUDES="$INCLUDES -pthread" - THREADDLLIBS=-pthread - $as_echo "#define _REENTRANT 1" >>confdefs.h + INCLUDES="$INCLUDES -pthread" + THREADDLLIBS=-pthread + $as_echo "#define _REENTRANT 1" >>confdefs.h if test "${enable_parallel_mark}" = yes; then - $as_echo "#define PARALLEL_MARK 1" >>confdefs.h + $as_echo "#define PARALLEL_MARK 1" >>confdefs.h - fi - $as_echo "#define THREAD_LOCAL_ALLOC 1" >>confdefs.h + fi + $as_echo "#define THREAD_LOCAL_ALLOC 1" >>confdefs.h - $as_echo "#define USE_COMPILER_TLS 1" >>confdefs.h + $as_echo "#define USE_COMPILER_TLS 1" >>confdefs.h - ;; + ;; *-*-gnu*) - $as_echo "#define GC_GNU_THREADS 1" >>confdefs.h + $as_echo "#define GC_GNU_THREADS 1" >>confdefs.h - $as_echo "#define _REENTRANT 1" >>confdefs.h + $as_echo "#define _REENTRANT 1" >>confdefs.h - $as_echo "#define THREAD_LOCAL_ALLOC 1" >>confdefs.h + $as_echo "#define THREAD_LOCAL_ALLOC 1" >>confdefs.h - ;; + ;; *-*-netbsd*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"Only on NetBSD 2.0 or later.\"" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"Only on NetBSD 2.0 or later.\"" >&5 $as_echo "$as_me: WARNING: \"Only on NetBSD 2.0 or later.\"" >&2;} - $as_echo "#define GC_NETBSD_THREADS 1" >>confdefs.h + $as_echo "#define GC_NETBSD_THREADS 1" >>confdefs.h - $as_echo "#define _REENTRANT 1" >>confdefs.h + $as_echo "#define _REENTRANT 1" >>confdefs.h - $as_echo "#define _PTHREADS 1" >>confdefs.h + $as_echo "#define _PTHREADS 1" >>confdefs.h - THREADDLLIBS="-lpthread -lrt" - ;; + THREADDLLIBS="-lpthread -lrt" + ;; *-*-solaris*) - $as_echo "#define GC_SOLARIS_THREADS 1" >>confdefs.h + $as_echo "#define GC_SOLARIS_THREADS 1" >>confdefs.h - $as_echo "#define THREAD_LOCAL_ALLOC 1" >>confdefs.h + $as_echo "#define THREAD_LOCAL_ALLOC 1" >>confdefs.h - THREADDLLIBS="-lpthread -lrt" - if test "$GCC" != yes; then + THREADDLLIBS="-lpthread -lrt" + if test "$GCC" != yes; then CFLAGS="$CFLAGS -O" need_atomic_ops_asm=true fi - ;; + ;; *-*-irix*) - $as_echo "#define GC_IRIX_THREADS 1" >>confdefs.h + $as_echo "#define GC_IRIX_THREADS 1" >>confdefs.h - ;; + ;; *-*-cygwin*) - $as_echo "#define GC_THREADS 1" >>confdefs.h + $as_echo "#define GC_THREADS 1" >>confdefs.h if test "${enable_parallel_mark}" = yes; then - $as_echo "#define PARALLEL_MARK 1" >>confdefs.h + $as_echo "#define PARALLEL_MARK 1" >>confdefs.h - fi - $as_echo "#define THREAD_LOCAL_ALLOC 1" >>confdefs.h + fi + $as_echo "#define THREAD_LOCAL_ALLOC 1" >>confdefs.h - # Cygwin doesn't have a real libpthread, so Libtool can't link - # against it. - THREADDLLIBS="" - win32_threads=true - ;; + # Cygwin doesn't have a real libpthread, so Libtool can't link + # against it. + THREADDLLIBS="" + win32_threads=true + ;; *-*-darwin*) - $as_echo "#define GC_DARWIN_THREADS 1" >>confdefs.h + $as_echo "#define GC_DARWIN_THREADS 1" >>confdefs.h - $as_echo "#define THREAD_LOCAL_ALLOC 1" >>confdefs.h + $as_echo "#define THREAD_LOCAL_ALLOC 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"Explicit GC_INIT() calls may be required.\"" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"Explicit GC_INIT() calls may be required.\"" >&5 $as_echo "$as_me: WARNING: \"Explicit GC_INIT() calls may be required.\"" >&2;}; - # Parallel-mark is currently unreliable on Darwin; ignore request - # if test "${enable_parallel_mark}" = yes; then - # AC_DEFINE(PARALLEL_MARK) - # fi - darwin_threads=true - ;; + # Parallel-mark is currently unreliable on Darwin; ignore request + # if test "${enable_parallel_mark}" = yes; then + # AC_DEFINE(PARALLEL_MARK) + # fi + darwin_threads=true + ;; *-*-osf*) - $as_echo "#define GC_OSF1_THREADS 1" >>confdefs.h + $as_echo "#define GC_OSF1_THREADS 1" >>confdefs.h if test "${enable_parallel_mark}" = yes; then - $as_echo "#define PARALLEL_MARK 1" >>confdefs.h + $as_echo "#define PARALLEL_MARK 1" >>confdefs.h - $as_echo "#define THREAD_LOCAL_ALLOC 1" >>confdefs.h + $as_echo "#define THREAD_LOCAL_ALLOC 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"Explicit GC_INIT() calls may be required.\"" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"Explicit GC_INIT() calls may be required.\"" >&5 $as_echo "$as_me: WARNING: \"Explicit GC_INIT() calls may be required.\"" >&2;}; - # May want to enable it in other cases, too. - # Measurements havent yet been done. - fi - INCLUDES="$INCLUDES -pthread" - THREADDLLIBS="-lpthread -lrt" - ;; + # May want to enable it in other cases, too. + # Measurements havent yet been done. + fi + INCLUDES="$INCLUDES -pthread" + THREADDLLIBS="-lpthread -lrt" + ;; *) - as_fn_error $? "\"Pthreads not supported by the GC on this platform.\"" "$LINENO" 5 - ;; + as_fn_error $? "\"Pthreads not supported by the GC on this platform.\"" "$LINENO" 5 + ;; esac ;; win32) @@ -5230,7 +5274,6 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xlc" >&5 $as_echo_n "checking for xlc... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -15360,13 +15403,13 @@ case "$host" in $as_echo "yes" >&6; } new_CFLAGS= for i in $CFLAGS; do - case "$i" in - -O*) - ;; - *) - new_CFLAGS="$new_CFLAGS $i" - ;; - esac + case "$i" in + -O*) + ;; + *) + new_CFLAGS="$new_CFLAGS $i" + ;; + esac done CFLAGS="$new_CFLAGS" else @@ -15424,9 +15467,9 @@ $as_echo "#define DBG_HDRS_ALL 1" >>confdefs.h case $host in ia64-*-linux* ) - $as_echo "#define MAKE_BACK_GRAPH 1" >>confdefs.h + $as_echo "#define MAKE_BACK_GRAPH 1" >>confdefs.h - $as_echo "#define SAVE_CALL_COUNT 8" >>confdefs.h + $as_echo "#define SAVE_CALL_COUNT 8" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for backtrace in -lunwind" >&5 $as_echo_n "checking for backtrace in -lunwind... " >&6; } @@ -15466,25 +15509,25 @@ fi $as_echo "$ac_cv_lib_unwind_backtrace" >&6; } if test "x$ac_cv_lib_unwind_backtrace" = x""yes; then : - $as_echo "#define GC_HAVE_BUILTIN_BACKTRACE 1" >>confdefs.h + $as_echo "#define GC_HAVE_BUILTIN_BACKTRACE 1" >>confdefs.h - UNWINDLIBS=-lunwind - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"Client code may need to link against libunwind.\"" >&5 + UNWINDLIBS=-lunwind + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"Client code may need to link against libunwind.\"" >&5 $as_echo "$as_me: WARNING: \"Client code may need to link against libunwind.\"" >&2;} fi ;; x86-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* ) - $as_echo "#define MAKE_BACK_GRAPH 1" >>confdefs.h + $as_echo "#define MAKE_BACK_GRAPH 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"Client must not use -fomit-frame-pointer.\"" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"Client must not use -fomit-frame-pointer.\"" >&5 $as_echo "$as_me: WARNING: \"Client must not use -fomit-frame-pointer.\"" >&2;} - $as_echo "#define SAVE_CALL_COUNT 8" >>confdefs.h + $as_echo "#define SAVE_CALL_COUNT 8" >>confdefs.h ;; i345686-*-dgux*) - $as_echo "#define MAKE_BACK_GRAPH 1" >>confdefs.h + $as_echo "#define MAKE_BACK_GRAPH 1" >>confdefs.h ;; esac @@ -15540,7 +15583,7 @@ $as_echo "#define REDIRECT_REALLOC GC_debug_realloc_replacement" >>confdefs.h $as_echo "#define REDIRECT_FREE GC_debug_free" >>confdefs.h else - $as_echo "#define REDIRECT_MALLOC GC_malloc" >>confdefs.h + $as_echo "#define REDIRECT_MALLOC GC_malloc" >>confdefs.h fi @@ -15648,7 +15691,7 @@ else if test x"$with_libatomic_ops" != xcheck; then : as_fn_error $? "A pre-installed libatomic_ops was not found." "$LINENO" 5 fi - with_libatomic_ops=no + with_libatomic_ops=no fi diff --git a/configure.ac b/configure.ac index 8811153c..c98ba41f 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,7 @@ AC_CONFIG_SRCDIR(gcj_mlc.c) AC_CONFIG_MACRO_DIR([m4]) AC_CANONICAL_TARGET AC_PREREQ(2.53) -AC_REVISION($Revision: 1.61 $) +AC_REVISION($Revision: 1.62 $) GC_SET_VERSION AM_INIT_AUTOMAKE([foreign dist-bzip2 nostdinc]) AM_CONFIG_HEADER([include/private/config.h]) @@ -59,11 +59,11 @@ AC_ARG_ENABLE(threads, AC_ARG_ENABLE(parallel-mark, [AC_HELP_STRING([--enable-parallel-mark], - [parallelize marking and free list construction])], + [parallelize marking and free list construction])], [case "$THREADS" in no | none | single) - AC_MSG_ERROR([Parallel mark requires --enable-threads=x spec]) - ;; + AC_MSG_ERROR([Parallel mark requires --enable-threads=x spec]) + ;; esac ] ) @@ -73,12 +73,12 @@ AC_ARG_ENABLE(cplusplus, dnl Features which may be selected in the following thread-detection switch. AH_TEMPLATE([PARALLEL_MARK], [Define to enable parallel marking.]) AH_TEMPLATE([THREAD_LOCAL_ALLOC], - [Define to enable thread-local allocation optimisation.]) + [Define to enable thread-local allocation optimisation.]) AH_TEMPLATE([USE_COMPILER_TLS], - [Define to use of compiler-support for thread-local variables.]) + [Define to use of compiler-support for thread-local variables.]) dnl Thread selection macros. -AH_TEMPLATE([GC_THREADS], [Define to support threads.]) +AH_TEMPLATE([GC_THREADS], [Define to support threads.]) AH_TEMPLATE([GC_AIX_THREADS], [Define to support IBM AIX threads.]) AH_TEMPLATE([GC_DARWIN_THREADS], [Define to support Darwin pthreads.]) AH_TEMPLATE([GC_FREEBSD_THREADS], [Define to support FreeBSD pthreads.]) @@ -96,6 +96,9 @@ dnl System header feature requests. AH_TEMPLATE([_POSIX_C_SOURCE], [The POSIX feature macro.]) AH_TEMPLATE([_PTHREADS], [Indicates the use of pthreads (NetBSD).]) +dnl Check for a flavor of supported inline keyword. +AC_C_INLINE + THREADDLLIBS= need_atomic_ops_asm=false ## Libraries needed to support dynamic loading and/or threads. @@ -108,38 +111,38 @@ case "$THREADS" in THREADDLLIBS=-lpthread case "$host" in x86-*-linux* | ia64-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* | alpha-*-linux* | sparc*-*-linux*) - AC_DEFINE(GC_LINUX_THREADS) - AC_DEFINE(_REENTRANT) + AC_DEFINE(GC_LINUX_THREADS) + AC_DEFINE(_REENTRANT) if test "${enable_parallel_mark}" = yes; then - AC_DEFINE(PARALLEL_MARK) - fi - AC_DEFINE(THREAD_LOCAL_ALLOC) - AC_MSG_WARN("Explicit GC_INIT() calls may be required."); - ;; + AC_DEFINE(PARALLEL_MARK) + fi + AC_DEFINE(THREAD_LOCAL_ALLOC) + AC_MSG_WARN("Explicit GC_INIT() calls may be required."); + ;; *-*-linux*) - AC_DEFINE(GC_LINUX_THREADS) - AC_DEFINE(_REENTRANT) - ;; + AC_DEFINE(GC_LINUX_THREADS) + AC_DEFINE(_REENTRANT) + ;; *-*-aix*) - AC_DEFINE(GC_AIX_THREADS) - AC_DEFINE(_REENTRANT) - ;; + AC_DEFINE(GC_AIX_THREADS) + AC_DEFINE(_REENTRANT) + ;; *-*-hpux11*) - AC_MSG_WARN("Only HP/UX 11 POSIX threads are supported.") - AC_DEFINE(GC_HPUX_THREADS) - AC_DEFINE(_POSIX_C_SOURCE,199506L) - if test "${enable_parallel_mark}" = yes; then - AC_DEFINE(PARALLEL_MARK) - fi - AC_DEFINE(THREAD_LOCAL_ALLOC) - AC_MSG_WARN("Explicit GC_INIT() calls may be required."); - THREADDLLIBS="-lpthread -lrt" - # HPUX needs REENTRANT for the _r calls. - AC_DEFINE(_REENTRANT, 1, [Required define if using POSIX threads.]) - ;; + AC_MSG_WARN("Only HP/UX 11 POSIX threads are supported.") + AC_DEFINE(GC_HPUX_THREADS) + AC_DEFINE(_POSIX_C_SOURCE,199506L) + if test "${enable_parallel_mark}" = yes; then + AC_DEFINE(PARALLEL_MARK) + fi + AC_DEFINE(THREAD_LOCAL_ALLOC) + AC_MSG_WARN("Explicit GC_INIT() calls may be required."); + THREADDLLIBS="-lpthread -lrt" + # HPUX needs REENTRANT for the _r calls. + AC_DEFINE(_REENTRANT, 1, [Required define if using POSIX threads.]) + ;; *-*-hpux10*) - AC_MSG_WARN("Only HP-UX 11 POSIX threads are supported.") - ;; + AC_MSG_WARN("Only HP-UX 11 POSIX threads are supported.") + ;; *-*-openbsd*) AC_DEFINE(GC_OPENBSD_THREADS) THREADDLLIBS=-pthread @@ -147,81 +150,81 @@ case "$THREADS" in openbsd_threads=true ;; *-*-freebsd*) - AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.") - AC_DEFINE(GC_FREEBSD_THREADS) - INCLUDES="$INCLUDES -pthread" - ;; + AC_MSG_WARN("FreeBSD does not yet fully support threads with Boehm GC.") + AC_DEFINE(GC_FREEBSD_THREADS) + INCLUDES="$INCLUDES -pthread" + ;; *-*-kfreebsd*-gnu) - AC_DEFINE(GC_FREEBSD_THREADS) - INCLUDES="$INCLUDES -pthread" - THREADDLLIBS=-pthread - AC_DEFINE(_REENTRANT) + AC_DEFINE(GC_FREEBSD_THREADS) + INCLUDES="$INCLUDES -pthread" + THREADDLLIBS=-pthread + AC_DEFINE(_REENTRANT) if test "${enable_parallel_mark}" = yes; then - AC_DEFINE(PARALLEL_MARK) - fi - AC_DEFINE(THREAD_LOCAL_ALLOC) - AC_DEFINE(USE_COMPILER_TLS) - ;; + AC_DEFINE(PARALLEL_MARK) + fi + AC_DEFINE(THREAD_LOCAL_ALLOC) + AC_DEFINE(USE_COMPILER_TLS) + ;; *-*-gnu*) - AC_DEFINE(GC_GNU_THREADS) - AC_DEFINE(_REENTRANT) - AC_DEFINE(THREAD_LOCAL_ALLOC) - ;; + AC_DEFINE(GC_GNU_THREADS) + AC_DEFINE(_REENTRANT) + AC_DEFINE(THREAD_LOCAL_ALLOC) + ;; *-*-netbsd*) - AC_MSG_WARN("Only on NetBSD 2.0 or later.") - AC_DEFINE(GC_NETBSD_THREADS) - AC_DEFINE(_REENTRANT) - AC_DEFINE(_PTHREADS) - THREADDLLIBS="-lpthread -lrt" - ;; + AC_MSG_WARN("Only on NetBSD 2.0 or later.") + AC_DEFINE(GC_NETBSD_THREADS) + AC_DEFINE(_REENTRANT) + AC_DEFINE(_PTHREADS) + THREADDLLIBS="-lpthread -lrt" + ;; *-*-solaris*) - AC_DEFINE(GC_SOLARIS_THREADS) - AC_DEFINE(THREAD_LOCAL_ALLOC) - THREADDLLIBS="-lpthread -lrt" - if test "$GCC" != yes; then + AC_DEFINE(GC_SOLARIS_THREADS) + AC_DEFINE(THREAD_LOCAL_ALLOC) + THREADDLLIBS="-lpthread -lrt" + if test "$GCC" != yes; then CFLAGS="$CFLAGS -O" need_atomic_ops_asm=true fi - ;; + ;; *-*-irix*) - AC_DEFINE(GC_IRIX_THREADS) - ;; + AC_DEFINE(GC_IRIX_THREADS) + ;; *-*-cygwin*) - AC_DEFINE(GC_THREADS) + AC_DEFINE(GC_THREADS) if test "${enable_parallel_mark}" = yes; then - AC_DEFINE(PARALLEL_MARK) - fi - AC_DEFINE(THREAD_LOCAL_ALLOC) - # Cygwin doesn't have a real libpthread, so Libtool can't link - # against it. - THREADDLLIBS="" - win32_threads=true - ;; + AC_DEFINE(PARALLEL_MARK) + fi + AC_DEFINE(THREAD_LOCAL_ALLOC) + # Cygwin doesn't have a real libpthread, so Libtool can't link + # against it. + THREADDLLIBS="" + win32_threads=true + ;; *-*-darwin*) - AC_DEFINE(GC_DARWIN_THREADS) - AC_DEFINE(THREAD_LOCAL_ALLOC) - AC_MSG_WARN("Explicit GC_INIT() calls may be required."); - # Parallel-mark is currently unreliable on Darwin; ignore request - # if test "${enable_parallel_mark}" = yes; then - # AC_DEFINE(PARALLEL_MARK) - # fi - darwin_threads=true - ;; + AC_DEFINE(GC_DARWIN_THREADS) + AC_DEFINE(THREAD_LOCAL_ALLOC) + AC_MSG_WARN("Explicit GC_INIT() calls may be required."); + # Parallel-mark is currently unreliable on Darwin; ignore request + # if test "${enable_parallel_mark}" = yes; then + # AC_DEFINE(PARALLEL_MARK) + # fi + darwin_threads=true + ;; *-*-osf*) - AC_DEFINE(GC_OSF1_THREADS) + AC_DEFINE(GC_OSF1_THREADS) if test "${enable_parallel_mark}" = yes; then - AC_DEFINE(PARALLEL_MARK) - AC_DEFINE(THREAD_LOCAL_ALLOC) - AC_MSG_WARN("Explicit GC_INIT() calls may be required."); - # May want to enable it in other cases, too. - # Measurements havent yet been done. - fi - INCLUDES="$INCLUDES -pthread" - THREADDLLIBS="-lpthread -lrt" - ;; + AC_DEFINE(PARALLEL_MARK) + AC_DEFINE(THREAD_LOCAL_ALLOC) + AC_MSG_WARN("Explicit GC_INIT() calls may be required."); + # May want to enable it in other cases, too. + # Measurements havent yet been done. + fi + INCLUDES="$INCLUDES -pthread" + THREADDLLIBS="-lpthread -lrt" + ;; *) - AC_MSG_ERROR("Pthreads not supported by the GC on this platform.") - ;; + AC_MSG_ERROR("Pthreads not supported by the GC on this platform.") + ;; esac ;; win32) @@ -232,7 +235,7 @@ case "$THREADS" in fi win32_threads=true AC_DEFINE([EMPTY_GETENV_RESULTS], [1], - [Wine getenv may not return NULL for missing entry.]) + [Wine getenv may not return NULL for missing entry.]) ;; dgux386) THREADS=dgux386 @@ -245,9 +248,9 @@ case "$THREADS" in AC_DEFINE(THREAD_LOCAL_ALLOC) AC_MSG_WARN("Explicit GC_INIT() calls may be required."); AC_DEFINE([GC_DGUX386_THREADS], 1, - [Define to enable support for DB/UX threads on i386.]) + [Define to enable support for DB/UX threads on i386.]) AC_DEFINE([DGUX_THREADS], 1, - [Define to enable support for DB/UX threads.]) + [Define to enable support for DB/UX threads.]) # Enable _POSIX4A_DRAFT10_SOURCE with flag -pthread INCLUDES="-pthread $INCLUDES" ;; @@ -383,7 +386,7 @@ case "$host" in ;; i?86-*-solaris2.[[89]] | i?86-*-solaris2.1?) AC_DEFINE([SOLARIS25_PROC_VDB_BUG_FIXED], 1, - [See the comment in gcconfig.h.]) + [See the comment in gcconfig.h.]) ;; mipstx39-*-elf*) machdep="mach_dep.lo" @@ -416,7 +419,7 @@ case "$host" in sparc-sun-solaris2.3) machdep="mach_dep.lo sparc_mach_dep.lo" AC_DEFINE(SUNOS53_SHARED_LIB, 1, - [Define to work around a Solaris 5.3 bug (see dyn_load.c).]) + [Define to work around a Solaris 5.3 bug (see dyn_load.c).]) ;; sparc*-sun-solaris2*) machdep="mach_dep.lo sparc_mach_dep.lo" @@ -484,13 +487,13 @@ case "$host" in AC_MSG_RESULT(yes) new_CFLAGS= for i in $CFLAGS; do - case "$i" in - -O*) - ;; - *) - new_CFLAGS="$new_CFLAGS $i" - ;; - esac + case "$i" in + -O*) + ;; + *) + new_CFLAGS="$new_CFLAGS $i" + ;; + esac done CFLAGS="$new_CFLAGS" else @@ -503,9 +506,9 @@ esac dnl Include defines that have become de facto standard. dnl ALL_INTERIOR_POINTERS and NO_EXECUTE_PERMISSION can be overridden in the startup code. AC_DEFINE([NO_EXECUTE_PERMISSION], [1], - [Define to make the collector not allocate executable memory by default.]) + [Define to make the collector not allocate executable memory by default.]) AC_DEFINE([ALL_INTERIOR_POINTERS], [1], - [Define to recognise all pointers to the interior of objects.]) + [Define to recognise all pointers to the interior of objects.]) dnl Interface Selection @@ -515,7 +518,7 @@ dnl By default, make the library as general as possible. dnl enable_gcj_support=no AC_ARG_ENABLE(gcj-support, [AC_HELP_STRING([--disable-gcj-support], - [Disable support for gcj.])]) + [Disable support for gcj.])]) AM_CONDITIONAL(ENABLE_GCJ_SUPPORT, [test x"$enable_gcj_support" != xno]) if test x"$enable_gcj_support" != xno; then @@ -526,11 +529,11 @@ dnl Debugging dnl --------- AH_TEMPLATE([GC_HAVE_BUILTIN_BACKTRACE], - [Define if backtrace information is supported.]) + [Define if backtrace information is supported.]) AH_TEMPLATE([MAKE_BACK_GRAPH], [See doc/README.macros.]) AH_TEMPLATE([SAVE_CALL_COUNT], - [The number of caller frames saved when allocating with the - debugging API.]) + [The number of caller frames saved when allocating with the + debugging API.]) UNWINDLIBS= AC_ARG_ENABLE(gc-debug, [AC_HELP_STRING([--enable-gc-debug], @@ -538,27 +541,27 @@ AC_ARG_ENABLE(gc-debug, [ if test "$enable_gc_debug" = "yes"; then AC_MSG_WARN("Should define GC_DEBUG and use debug alloc. in clients.") AC_DEFINE([KEEP_BACK_PTRS], 1, - [Define to save back-pointers in debugging headers.]) + [Define to save back-pointers in debugging headers.]) keep_back_ptrs=true AC_DEFINE([DBG_HDRS_ALL], 1, - [Define to force debug headers on all objects.]) + [Define to force debug headers on all objects.]) case $host in ia64-*-linux* ) - AC_DEFINE(MAKE_BACK_GRAPH) - AC_DEFINE(SAVE_CALL_COUNT, 8) + AC_DEFINE(MAKE_BACK_GRAPH) + AC_DEFINE(SAVE_CALL_COUNT, 8) AC_CHECK_LIB(unwind, backtrace, [ - AC_DEFINE(GC_HAVE_BUILTIN_BACKTRACE) - UNWINDLIBS=-lunwind - AC_MSG_WARN("Client code may need to link against libunwind.") - ]) + AC_DEFINE(GC_HAVE_BUILTIN_BACKTRACE) + UNWINDLIBS=-lunwind + AC_MSG_WARN("Client code may need to link against libunwind.") + ]) ;; x86-*-linux* | i586-*-linux* | i686-*-linux* | x86_64-*-linux* ) - AC_DEFINE(MAKE_BACK_GRAPH) - AC_MSG_WARN("Client must not use -fomit-frame-pointer.") - AC_DEFINE(SAVE_CALL_COUNT, 8) + AC_DEFINE(MAKE_BACK_GRAPH) + AC_MSG_WARN("Client must not use -fomit-frame-pointer.") + AC_DEFINE(SAVE_CALL_COUNT, 8) ;; i[3456]86-*-dgux*) - AC_DEFINE(MAKE_BACK_GRAPH) + AC_DEFINE(MAKE_BACK_GRAPH) ;; esac ] fi) @@ -566,40 +569,40 @@ AM_CONDITIONAL([KEEP_BACK_PTRS], [test x"$keep_back_ptrs" = xtrue]) AC_ARG_ENABLE(java-finalization, [AC_HELP_STRING([--disable-java-finalization], - [Disable support for java finalization.])]) + [Disable support for java finalization.])]) if test x"$enable_java_finalization" != xno; then AC_DEFINE([JAVA_FINALIZATION], 1, [See doc/README.macros.]) fi AC_ARG_ENABLE(atomic-uncollectable, [AC_HELP_STRING([--disable-atomic-uncollectible], - [Disable support for atomic uncollectible allocation.])]) + [Disable support for atomic uncollectible allocation.])]) if test x"$enable_atomic_uncollectible" != x"no"; then AC_DEFINE(ATOMIC_UNCOLLECTABLE, 1, - [Define to enable atomic uncollectible allocation.]) + [Define to enable atomic uncollectible allocation.]) fi AC_ARG_ENABLE(redirect-malloc, [AC_HELP_STRING([--enable-redirect-malloc], - [Redirect malloc and friends to GC routines])]) + [Redirect malloc and friends to GC routines])]) if test "${enable_redirect_malloc}" = yes; then if test "${enable_gc_debug}" = yes; then - AC_DEFINE([REDIRECT_MALLOC], GC_debug_malloc_replacement, - [If defined, redirect malloc to this function.]) - AC_DEFINE([REDIRECT_REALLOC], GC_debug_realloc_replacement, - [If defined, redirect GC_realloc to this function.]) - AC_DEFINE([REDIRECT_FREE], GC_debug_free, - [If defined, redirect free to this function.]) + AC_DEFINE([REDIRECT_MALLOC], GC_debug_malloc_replacement, + [If defined, redirect malloc to this function.]) + AC_DEFINE([REDIRECT_REALLOC], GC_debug_realloc_replacement, + [If defined, redirect GC_realloc to this function.]) + AC_DEFINE([REDIRECT_FREE], GC_debug_free, + [If defined, redirect free to this function.]) else - AC_DEFINE(REDIRECT_MALLOC, GC_malloc) + AC_DEFINE(REDIRECT_MALLOC, GC_malloc) fi AC_DEFINE([GC_USE_DLOPEN_WRAP], 1, [See doc/README.macros.]) fi AC_ARG_ENABLE(large-config, [AC_HELP_STRING([--enable-large-config], - [Optimize for large (> 100 MB) heap or root set])]) + [Optimize for large (> 100 MB) heap or root set])]) if test "${enable_large_config}" = yes; then AC_DEFINE(LARGE_CONFIG, 1, [Define to optimize for large heaps or root sets.]) @@ -611,9 +614,9 @@ dnl These is only correct when targetting an embedded system. FIXME. if test -n "${with_cross_host}"; then AC_DEFINE([NO_CLOCK], 1, [Define to not use system clock (cross compiling).]) AC_DEFINE([SMALL_CONFIG], 1, - [Define to tune the collector for small heap sizes.]) + [Define to tune the collector for small heap sizes.]) AC_DEFINE([NO_DEBUGGING], 1, - [Disable debugging, like GC_dump and its callees.]) + [Disable debugging, like GC_dump and its callees.]) fi @@ -621,14 +624,14 @@ AC_SUBST(UNWINDLIBS) AC_ARG_ENABLE(gc-assertions, [AC_HELP_STRING([--enable-gc-assertions], - [collector-internal assertion checking])]) + [collector-internal assertion checking])]) if test "${enable_gc_assertions}" = yes; then AC_DEFINE([GC_ASSERTIONS], 1, [Define to enable internal debug assertions.]) fi AC_ARG_ENABLE(munmap, [AC_HELP_STRING([--enable-munmap=N], - [return page to the os if empty for N collections])], + [return page to the os if empty for N collections])], MUNMAP_THRESHOLD=$enableval; [case "$MMAP" in no) @@ -638,15 +641,15 @@ AC_ARG_ENABLE(munmap, ) if test "${enable_munmap}" != ""; then AC_DEFINE([USE_MMAP], 1, - [Define to use mmap instead of sbrk to expand the heap.]) + [Define to use mmap instead of sbrk to expand the heap.]) AC_DEFINE([USE_MUNMAP], 1, - [Define to return memory to OS with munmap calls - (see doc/README.macros).]) + [Define to return memory to OS with munmap calls + (see doc/README.macros).]) if test "${MUNMAP_THRESHOLD}" = "yes"; then MUNMAP_THRESHOLD=6 fi AC_DEFINE_UNQUOTED([MUNMAP_THRESHOLD], [${MUNMAP_THRESHOLD}], - [Number of GC cycles to wait before unmapping an unused block.]) + [Number of GC cycles to wait before unmapping an unused block.]) fi AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host") @@ -659,7 +662,7 @@ AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host") # found. AC_ARG_WITH([libatomic-ops], [AS_HELP_STRING([--with-libatomic-ops[=yes|no|check]], - [Use a pre-installed libatomic_ops? (default: check)])], + [Use a pre-installed libatomic_ops? (default: check)])], [], [with_libatomic_ops=check]) # Check for an external libatomic_ops if the answer was yes or check. If not @@ -667,8 +670,8 @@ AC_ARG_WITH([libatomic-ops], AS_IF([test x"$with_libatomic_ops" != xno], [ AC_CHECK_HEADER([atomic_ops.h], [], [ AS_IF([test x"$with_libatomic_ops" != xcheck], - [AC_MSG_ERROR([A pre-installed libatomic_ops was not found.])]) - with_libatomic_ops=no ]) ]) + [AC_MSG_ERROR([A pre-installed libatomic_ops was not found.])]) + with_libatomic_ops=no ]) ]) # Finally, emit the definitions for bundled or pre-installed AO. AC_MSG_CHECKING([which libatomic_ops to use]) diff --git a/include/private/config.h.in b/include/private/config.h.in index 567bb092..6af87d14 100644 --- a/include/private/config.h.in +++ b/include/private/config.h.in @@ -217,3 +217,9 @@ /* Required define if using POSIX threads. */ #undef _REENTRANT + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h index c93aac96..b518bf68 100644 --- a/include/private/gc_priv.h +++ b/include/private/gc_priv.h @@ -137,7 +137,10 @@ typedef char * ptr_t; /* A generic pointer to which we can add */ # define EXPECT(expr, outcome) (expr) #endif /* __GNUC__ */ -#if defined(_MSC_VER) || defined(__INTEL_COMPILER) || defined(__DMC__) \ +#ifdef HAVE_CONFIG_H + /* The `inline' keyword as determined by Autoconf's `AC_C_INLINE'. */ +# define GC_INLINE static inline +#elif defined(_MSC_VER) || defined(__INTEL_COMPILER) || defined(__DMC__) \ || defined(__WATCOMC__) # define GC_INLINE static __inline #elif (__GNUC__ >= 3) || defined(__sun) -- 2.40.0