diff --git a/doc/ref/api-foreign.texi b/doc/ref/api-foreign.texi index bb93d6d1f..d99a33300 100644 --- a/doc/ref/api-foreign.texi +++ b/doc/ref/api-foreign.texi @@ -498,6 +498,8 @@ platform-dependent size: @defvrx {Scheme Variable} size_t @defvrx {Scheme Variable} ssize_t @defvrx {Scheme Variable} ptrdiff_t +@defvrx {Scheme Variable} intptr_t +@defvrx {Scheme Variable} uintptr_t Values exported by the @code{(system foreign)} module, representing C numeric types. For example, @code{long} may be @code{equal?} to @code{int64} on a 64-bit platform. diff --git a/doc/ref/api-io.texi b/doc/ref/api-io.texi index 9bd78d229..24890a12e 100644 --- a/doc/ref/api-io.texi +++ b/doc/ref/api-io.texi @@ -115,9 +115,8 @@ Return @code{#t} if @var{x} is an output port, otherwise return Close the specified port object. Return @code{#t} if it successfully closes a port or @code{#f} if it was already closed. An exception may be raised if an error occurs, for example when flushing buffered output. -@xref{Buffering}, for more on buffered output. See also @ref{Ports and -File Descriptors, close}, for a procedure which can close file -descriptors. +@xref{Buffering}, for more on buffered output. @xref{Ports and File +Descriptors, close}, for a procedure which can close file descriptors. @end deffn @deffn {Scheme Procedure} port-closed? port diff --git a/doc/ref/api-peg.texi b/doc/ref/api-peg.texi index 0e16aab7e..cbe3edd34 100644 --- a/doc/ref/api-peg.texi +++ b/doc/ref/api-peg.texi @@ -17,11 +17,12 @@ Wikipedia has a clear and concise introduction to PEGs if you want to familiarize yourself with the syntax: @url{http://en.wikipedia.org/wiki/Parsing_expression_grammar}. -The module works by compiling PEGs down to lambda expressions. These -can either be stored in variables at compile-time by the define macros -(@code{define-peg-pattern} and @code{define-peg-string-patterns}) or calculated -explicitly at runtime with the compile functions -(@code{compile-peg-pattern} and @code{peg-string-compile}). +The @code{(ice-9 peg)} module works by compiling PEGs down to lambda +expressions. These can either be stored in variables at compile-time by +the define macros (@code{define-peg-pattern} and +@code{define-peg-string-patterns}) or calculated explicitly at runtime +with the compile functions (@code{compile-peg-pattern} and +@code{peg-string-compile}). They can then be used for either parsing (@code{match-pattern}) or searching (@code{search-for-pattern}). For convenience, @code{search-for-pattern} diff --git a/libguile/dynl.c b/libguile/dynl.c index b9497b1b3..2a25e5d2e 100644 --- a/libguile/dynl.c +++ b/libguile/dynl.c @@ -1,7 +1,7 @@ /* dynl.c - dynamic linking * * Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002, - * 2003, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. + * 2003, 2008, 2009, 2010, 2011, 2017 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -66,10 +66,9 @@ maybe_drag_in_eprintf () #include -/* - From the libtool manual: "Note that libltdl is not threadsafe, - i.e. a multithreaded application has to use a mutex for libltdl.". -*/ +/* From the libtool manual: "Note that libltdl is not threadsafe, + i.e. a multithreaded application has to use a mutex for libltdl.". + Note: We initialize it as a recursive mutex below. */ static scm_i_pthread_mutex_t ltdl_lock = SCM_I_PTHREAD_MUTEX_INITIALIZER; /* LT_PATH_SEP-separated extension library search path, searched last */ @@ -401,6 +400,13 @@ scm_init_dynamic_linking () { scm_tc16_dynamic_obj = scm_make_smob_type ("dynamic-object", 0); scm_set_smob_print (scm_tc16_dynamic_obj, dynl_obj_print); + + /* Make LTDL_LOCK recursive so that a pre-unwind handler can still use + 'dynamic-link', as is the case at the REPL. See + . */ + scm_i_pthread_mutex_init (<dl_lock, + scm_i_pthread_mutexattr_recursive); + sysdep_dynl_init (); #include "libguile/dynl.x" } diff --git a/libguile/foreign.c b/libguile/foreign.c index 17af10180..927c46fad 100644 --- a/libguile/foreign.c +++ b/libguile/foreign.c @@ -56,6 +56,8 @@ SCM_SYMBOL (sym_unsigned_long, "unsigned-long"); SCM_SYMBOL (sym_size_t, "size_t"); SCM_SYMBOL (sym_ssize_t, "ssize_t"); SCM_SYMBOL (sym_ptrdiff_t, "ptrdiff_t"); +SCM_SYMBOL (sym_intptr_t, "intptr_t"); +SCM_SYMBOL (sym_uintptr_t, "uintptr_t"); /* that's for pointers, you know. */ SCM_SYMBOL (sym_asterisk, "*"); @@ -1245,6 +1247,26 @@ scm_init_foreign (void) scm_from_uint8 (SCM_FOREIGN_TYPE_INT32) #else # error unsupported sizeof (scm_t_ptrdiff) +#endif + ); + + scm_define (sym_intptr_t, +#if SCM_SIZEOF_INTPTR_T == 8 + scm_from_uint8 (SCM_FOREIGN_TYPE_INT64) +#elif SCM_SIZEOF_INTPTR_T == 4 + scm_from_uint8 (SCM_FOREIGN_TYPE_INT32) +#else +# error unsupported sizeof (scm_t_intptr) +#endif + ); + + scm_define (sym_uintptr_t, +#if SCM_SIZEOF_UINTPTR_T == 8 + scm_from_uint8 (SCM_FOREIGN_TYPE_UINT64) +#elif SCM_SIZEOF_UINTPTR_T == 4 + scm_from_uint8 (SCM_FOREIGN_TYPE_UINT32) +#else +# error unsupported sizeof (scm_t_uintptr) #endif ); diff --git a/libguile/threads.c b/libguile/threads.c index 9ceb5b88a..770f62c44 100644 --- a/libguile/threads.c +++ b/libguile/threads.c @@ -395,6 +395,7 @@ guilify_self_1 (struct GC_stack_base *base, int needs_unregister) t.base = base->mem_base; #ifdef __ia64__ t.register_backing_store_base = base->reg_base; + t.pending_rbs_continuation = 0; #endif t.continuation_root = SCM_EOL; t.continuation_base = t.base; diff --git a/module/scripts/help.scm b/module/scripts/help.scm index 4e0f47c32..34400db3a 100644 --- a/module/scripts/help.scm +++ b/module/scripts/help.scm @@ -115,7 +115,7 @@ For help on a specific command, try \"guild help COMMAND\". Report guild bugs to ~a GNU Guile home page: General help using GNU software: -For complete documentation, run: info guile 'Using Guile Tools' +For complete documentation, run: info '(guile)Using Guile Tools' " %guile-bug-report-address)) (define (module-commentary mod) diff --git a/module/system/foreign.scm b/module/system/foreign.scm index 3304eb015..d1c2ceb96 100644 --- a/module/system/foreign.scm +++ b/module/system/foreign.scm @@ -30,6 +30,7 @@ uint16 int16 uint32 int32 uint64 int64 + intptr_t uintptr_t sizeof alignof