Fixes <http://bugs.gnu.org/15798>.
Reported by Matt Sicker <boards@gmail.com>.
* libguile/__scm.h (SCM_NORETURN): Use ((__noreturn__)) instead of
((noreturn)).
* libguile/throw.h (scm_ithrow): Rename formal parameter from 'noreturn'
to 'no_return'.
* libguile/throw.c (scm_ithrow): Rename formal parameter from 'noreturn'
to 'no_return'.
Reported by Jan Schukat <shookie@email.de>.
Partly fixes <http://bugs.gnu.org/13848>.
* libguile/__scm.h (SCM_LONG_BIT)[!defined LONG_BIT]: Use
SCM_SIZEOF_LONG since `sizeof' cannot be used in #if directives as
found in numbers.c.
There is a failing test due to a scm_from_utf8_stringn bug brought out
by the iconv test that will be fixed in the next commit.
Conflicts:
libguile/deprecated.h
module/ice-9/deprecated.scm
* libguile/__scm.h:
* libguile/deprecated.h (SCM_CHAR_CODE_LIMIT): Move declaration here
from __scm.h.
* libguile/feature.c:
* module/ice-9/deprecated.scm (char-code-limit): Move definition here.
* test-suite/tests/regexp.test: Update to not use char-code-limit.
* libguile/__scm.h (SCM_C_EXTERN_INLINE): Move this definition here,
from inline.h. We'd like to support inline function definitions in
more header files: not just inline.h.
(SCM_CAN_INLINE, SCM_INLINE, SCM_INLINE_IMPLEMENTATION): New
definitions.
* libguile/gc.h (SCM_GC_MALLOC, SCM_GC_MALLOC_POINTERLESS): Define these
wrappers, which redirect to the GC_MALLOC macros when building Guile,
and the scm_gc_malloc functions otherwise. A step towards getting
BDW-GC out of Guile's API.
* libguile/inline.h: Simplify, using SCM_INLINE,
SCM_INLINE_IMPLEMENTATION, and SCM_IMPLEMENT_INLINES. Also use the
new SCM_GC_MALLOC macros.
* libguile/__scm.h (SCM_C_EXTERN_INLINE): Move this definition here,
from inline.h. We'd like to support inline function definitions in
more header files: not just inline.h.
(SCM_CAN_INLINE, SCM_INLINE, SCM_INLINE_IMPLEMENTATION): New
definitions.
* libguile/gc.h (SCM_GC_MALLOC, SCM_GC_MALLOC_POINTERLESS): Define these
wrappers, which redirect to the GC_MALLOC macros when building Guile,
and the scm_gc_malloc functions otherwise. A step towards getting
BDW-GC out of Guile's API.
* libguile/inline.h: Simplify, using SCM_INLINE,
SCM_INLINE_IMPLEMENTATION, and SCM_IMPLEMENT_INLINES. Also use the
new SCM_GC_MALLOC macros.
* libguile/__scm.h: Move all the SCM_WTA and SCM_GASSERT macros out of
here. Also remove the scm_call_generic declarations.
* libguile/deprecated.h (SCM_WTA_DISPATCH_0, SCM_WTA_DISPATCH_1):
(SCM_WTA_DISPATCH_2, SCM_WTA_DISPATCH_N): Deprecate. See below for
their replacements.
(SCM_GASSERT0, SCM_GASSERT1, SCM_GASSERT2, SCM_GASSERTn): Deprecate
these too.
(SCM_WTA_DISPATCH_1_SUBR): Deprecate this strange thing.
(scm_call_generic_0, scm_call_generic_1, scm_call_generic_2):
(scm_call_generic_3, scm_apply_generic): Remove, indicating their
replacements.
* libguile/print.c (iprin1):
* libguile/eq.c (scm_equal_p): Use scm_call_2 instead of
scm_call_generic_2.
* libguile/goops.h:
* libguile/goops.c: Remove scm_{call,apply}_generic definitions.
(scm_wta_dispatch_0, scm_wta_dispatch_1, scm_wta_dispatch_2):
(scm_wta_dispatch_n): New procedures, replacing the SCM_WTA macros.
* libguile/numbers.c (scm_lcm):
* libguile/procs.c (scm_setter): Remove uses of SCM_GASSERT.
* libguile/numbers.c (scm_lcm):
* libguile/procs.c (scm_setter):
* libguile/vectors.c: Use the procedural scm_wta routines instead of the
SCM_WTA macros.
* libguile/_scm.h (SCM_ASYNC_TICK, SCM_ASYNC_TICK_WITH_CODE): Make these
definitions private. Call the tick() function instead of click().
* libguile/__scm.h:
* libguile/async.h (scm_async_tick): Move declaration here. Remove
scm_async_click declaration. Tick is the new (and old!) click, you
see.
(SCM_CRITICAL_SECTION_END): Call tick() instead of click().
* libguile/async.c (scm_async_tick): Remove old definition, and rename
scm_async_click to scm_async_tick.
(decrease_block): Adapt to click() -> tick() name change.
* libguile/deprecated.h (scm_async_click, SCM_ASYNC_TICK): Define some
GONE macros.
* libguile/threads.c (fat_mutex_unlock): Tick() instead of click().
* libguile/_scm.h (SCM_I_SETJMP, SCM_I_LONGJMP): Move to this private
header.
* libguile/__scm.h (scm_i_jmp_buf): Only define the scm_i_jmp_buf type
in this public header.
* libguile/__scm.h: Inline an #ifndef CHEAP_CONTINUATIONS block for
VMS, as we always have full continuations.
* libguile/feature.c (scm_init_feature): Don't bother defining the
"full-continuation" feature.
* test-suite/standalone/test-num2integral.c (test_long_long):
(test_ulong_long): Replace SCM_I_LLONG and SCM_I_ULLONG defines with
their counterparts from limits.h.
* libguile/__scm.h: Remove SCM_I_LLONG and SCM_I_ULLONG limit defines.
* libguile/__scm.h: Remove defines for SCM_I_SIZE_MAX, SCM_I_SSIZE_MIN,
and SCM_I_SSIZE_MAX, as there is no longer a scm_t_size / scm_size_t
type.
* libguile/bytevectors.c (make_bytevector): Replace a use of
SCM_I_SIZE_MAX with ((size_t) -1).
* libguile/__scm.h: Remove SCM_CHAR_CODE_LIMIT define.
* libguile/feature.c (scm_init_feature): Remove char-code-limit define,
which was sure to be 256: a bogus value.
* libguile/tags.h: Elide the SCM_DEBUG_TYPING_STRICTNESS==1 case.
Instead just have a flag, SCM_USING_PREHISTORIC_COMPILER, which if set
uses what was SCM_DEBUG_TYPING_STRICTNESS==0.
* libguile/__scm.h: Remove SCM_DEBUG_TYPING_STRICTNESS block.
* libguile/__scm.h (SCM_ASYNC_TICK_WITH_CODE): Redefine to take a
scm_i_thread* as well. OK to do because it's within a
BUILDING_LIBGUILE block.
* libguile/vm-engine.c (vm_engine): Cache the scm_i_thread* instead of
the dynstate, so we can use the thread for ticks.
* libguile/vm-engine.h (VM_HANDLE_INTERRUPTS): Tick with the
scm_i_thread* local var, to avoid excessive tls calls.
* libguile/vm-i-system.c: Fix dynstate users to use
current_thread->dynamic_state.
* libguile/__scm.h (SCM_ASYNC_TICK): Add some branch prediction.
(SCM_ASYNC_TICK_WITH_CODE): New helper for when BUILDING_LIBGUILE,
runs code only if we're going to call async_click().
* libguile/vm-engine.h (VM_HANDLE_INTERRUPTS): New helper, uses
SCM_ASYNC_TICK_WITH_CODE to only save regs if we'll handle an
interrupt.
* libguile/vm-i-system.c (call, goto/args, return): use
VM_HANDLE_INTERRUPTS.
* configure.ac: Check for `intptr_t' and `uintptr_t'. Substitute
`SCM_I_GSC_T_INTPTR' and `SCM_I_GSC_T_UINPTR'.
* libguile/__scm.h (SCM_T_UINTPTR_MAX, SCM_T_INTPTR_MIN,
SCM_T_INTPTR_MAX): New macros.
* libguile/_scm.h (SIZEOF_SCM_T_BITS): New macro.
* libguile/gen-scmconfig.c (main): Produce typedefs for `scm_t_intptr'
and `scm_t_uintptr'.
* libguile/gen-scmconfig.h.in (SCM_I_GSC_T_INTPTR, SCM_I_GSC_T_UINPTR):
New macros.
* libguile/tags.h: Don't check for `HAVE_INTTYPES_H' and
`HAVE_STDINT_H'; don't include <inttypes.h> nor <stdint.h>.
(scm_t_signed_bits, scm_t_bits): Define unconditionally as aliases for
`scm_t_intptr' and `scm_t_uintptr', respectively.
(SCM_T_SIGNED_BITS_MAX, SCM_T_SIGNED_BITS_MIN, SCM_T_BITS_MAX):
Likewise.
(SIZEOF_SCM_T_BITS): Remove.
The intent is to allow compilation with `-Wundef', which in turn should
make it easier to catch erroneous uses of nonexistent macros.
* libguile/__scm.h: Don't assume `BUILDING_LIBGUILE' is defined.
* libguile/conv-uinteger.i.c (SCM_TO_TYPE_PROTO): Remove unneeded CPP
conditional on `TYPE_MIN == 0'.
* libguile/fports.c: Check for the definition of `HAVE_CHSIZE' and
`HAVE_FTRUNCATE', not for their value.
* libguile/ports.c: Likewise.
* libguile/numbers.c (guile_ieee_init): Likewise with `HAVE_DINFINITY'
and `HAVE_DQNAN'.
* test-suite/standalone/test-conversion.c (ieee_init): Likewise.
* libguile/strings.c: Likewise with `SCM_STRING_LENGTH_HISTOGRAM'.
* libguile/strings.h: Likewise.
* libguile/tags.h: Likewise with `HAVE_INTTYPES_H' and `HAVE_STDINT_H'.
* libguile/threads.c: Likewise with `HAVE_PTHREAD_GET_STACKADDR_NP'.
* libguile/vm-engine.c (VM_NAME): Likewise with `VM_CHECK_IP'.
* libguile/gen-scmconfig.c (main): Use "#ifdef HAVE_", not "#if HAVE_".
* libguile/socket.c (scm_setsockopt): Likewise.
* libguile/__scm.h (scm_async_tick): New declaration.
(SCM_ASYNC_TICK)[!BUILDING_LIBGUILE]: Use `scm_async_tick ()'.
* libguile/async.c (scm_critical_section_start,
scm_critical_section_end, scm_async_tick): New functions.
* libguile/async.h (scm_i_critical_section_mutex): Made internal.
(scm_critical_section_start, scm_critical_section_end): New
declarations.
(SCM_CRITICAL_SECTION_START,
SCM_CRITICAL_SECTION_END)[!BUILDING_LIBGUILE]: Use the same-named
function (lower-case).
* libguile/stackchk.h (SCM_STACK_OVERFLOW_P): Conditionalize on
`BUILDING_LIBGUILE'.
* libguile/threads.h (SCM_I_CURRENT_THREAD, scm_i_dynwinds,
scm_i_set_dynwinds, scm_i_last_debug_frame,
scm_i_set_last_debug_frame): Conditionalize on `BUILDING_LIBGUILE'.
Problem was that if an application includes both libguile.h and the
system's setjmp.h, and is compiled on IA64, it gets compile errors
because of jmp_buf, setjmp and longjmp being multiply defined.
* libguile/__scm.h (__ia64__): Define scm_i_jmp_buf, SCM_I_SETJMP and
SCM_I_LONGJMP instead of jmp_buf, setjmp and longjmp.
(all other platforms): Map scm_i_jmp_buf, SCM_I_SETJMP and
SCM_I_LONGJMP to jmp_buf, setjmp and longjmp.
* libguile/continuations.c (scm_make_continuation): Use `SCM_I_SETJMP'
instead of `setjmp'.
(copy_stack_and_call): Use `SCM_I_LONJMP' instead of `longjmp'.
(scm_ia64_longjmp): Use type `scm_i_jmp_buf' instead of `jmp_buf'.
* libguile/continuations.h (scm_t_contregs): Use type `scm_i_jmp_buf'
instead of `jmp_buf'.
* libguile/threads.c (suspend): Use `SCM_I_SETJMP' instead of
`setjmp'.
* libguile/threads.h (scm_i_thread): Use type `scm_i_jmp_buf' instead
of `jmp_buf'.
* libguile/throw.c (JBJMPBUF, make_jmpbuf, jmp_buf_and_retval): Use
type `scm_i_jmp_buf' instead of `jmp_buf'.
(scm_c_catch): Use `SCM_I_SETJMP' instead of `setjmp'.
(scm_ithrow): Use `SCM_I_LONGJMP' instead of `longjmp'.