1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 19:50:24 +02:00

Merge until 8e2314c46d from stable-2.2

This commit is contained in:
Andy Wingo 2017-11-29 21:13:40 +01:00
commit bfe70b129c
8 changed files with 46 additions and 14 deletions

View file

@ -498,6 +498,8 @@ platform-dependent size:
@defvrx {Scheme Variable} size_t @defvrx {Scheme Variable} size_t
@defvrx {Scheme Variable} ssize_t @defvrx {Scheme Variable} ssize_t
@defvrx {Scheme Variable} ptrdiff_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 Values exported by the @code{(system foreign)} module, representing C
numeric types. For example, @code{long} may be @code{equal?} to numeric types. For example, @code{long} may be @code{equal?} to
@code{int64} on a 64-bit platform. @code{int64} on a 64-bit platform.

View file

@ -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 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 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. be raised if an error occurs, for example when flushing buffered output.
@xref{Buffering}, for more on buffered output. See also @ref{Ports and @xref{Buffering}, for more on buffered output. @xref{Ports and File
File Descriptors, close}, for a procedure which can close file Descriptors, close}, for a procedure which can close file descriptors.
descriptors.
@end deffn @end deffn
@deffn {Scheme Procedure} port-closed? port @deffn {Scheme Procedure} port-closed? port

View file

@ -17,11 +17,12 @@ Wikipedia has a clear and concise introduction to PEGs if you want to
familiarize yourself with the syntax: familiarize yourself with the syntax:
@url{http://en.wikipedia.org/wiki/Parsing_expression_grammar}. @url{http://en.wikipedia.org/wiki/Parsing_expression_grammar}.
The module works by compiling PEGs down to lambda expressions. These The @code{(ice-9 peg)} module works by compiling PEGs down to lambda
can either be stored in variables at compile-time by the define macros expressions. These can either be stored in variables at compile-time by
(@code{define-peg-pattern} and @code{define-peg-string-patterns}) or calculated the define macros (@code{define-peg-pattern} and
explicitly at runtime with the compile functions @code{define-peg-string-patterns}) or calculated explicitly at runtime
(@code{compile-peg-pattern} and @code{peg-string-compile}). 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 They can then be used for either parsing (@code{match-pattern}) or searching
(@code{search-for-pattern}). For convenience, @code{search-for-pattern} (@code{search-for-pattern}). For convenience, @code{search-for-pattern}

View file

@ -1,7 +1,7 @@
/* dynl.c - dynamic linking /* dynl.c - dynamic linking
* *
* Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002, * 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 * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License * modify it under the terms of the GNU Lesser General Public License
@ -66,10 +66,9 @@ maybe_drag_in_eprintf ()
#include <ltdl.h> #include <ltdl.h>
/* /* From the libtool manual: "Note that libltdl is not threadsafe,
From the libtool manual: "Note that libltdl is not threadsafe,
i.e. a multithreaded application has to use a mutex for libltdl.". 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; static scm_i_pthread_mutex_t ltdl_lock = SCM_I_PTHREAD_MUTEX_INITIALIZER;
/* LT_PATH_SEP-separated extension library search path, searched last */ /* 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_tc16_dynamic_obj = scm_make_smob_type ("dynamic-object", 0);
scm_set_smob_print (scm_tc16_dynamic_obj, dynl_obj_print); 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
<https://bugs.gnu.org/29275>. */
scm_i_pthread_mutex_init (&ltdl_lock,
scm_i_pthread_mutexattr_recursive);
sysdep_dynl_init (); sysdep_dynl_init ();
#include "libguile/dynl.x" #include "libguile/dynl.x"
} }

View file

@ -56,6 +56,8 @@ SCM_SYMBOL (sym_unsigned_long, "unsigned-long");
SCM_SYMBOL (sym_size_t, "size_t"); SCM_SYMBOL (sym_size_t, "size_t");
SCM_SYMBOL (sym_ssize_t, "ssize_t"); SCM_SYMBOL (sym_ssize_t, "ssize_t");
SCM_SYMBOL (sym_ptrdiff_t, "ptrdiff_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. */ /* that's for pointers, you know. */
SCM_SYMBOL (sym_asterisk, "*"); SCM_SYMBOL (sym_asterisk, "*");
@ -1245,6 +1247,26 @@ scm_init_foreign (void)
scm_from_uint8 (SCM_FOREIGN_TYPE_INT32) scm_from_uint8 (SCM_FOREIGN_TYPE_INT32)
#else #else
# error unsupported sizeof (scm_t_ptrdiff) # 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 #endif
); );

View file

@ -395,6 +395,7 @@ guilify_self_1 (struct GC_stack_base *base, int needs_unregister)
t.base = base->mem_base; t.base = base->mem_base;
#ifdef __ia64__ #ifdef __ia64__
t.register_backing_store_base = base->reg_base; t.register_backing_store_base = base->reg_base;
t.pending_rbs_continuation = 0;
#endif #endif
t.continuation_root = SCM_EOL; t.continuation_root = SCM_EOL;
t.continuation_base = t.base; t.continuation_base = t.base;

View file

@ -115,7 +115,7 @@ For help on a specific command, try \"guild help COMMAND\".
Report guild bugs to ~a Report guild bugs to ~a
GNU Guile home page: <http://www.gnu.org/software/guile/> GNU Guile home page: <http://www.gnu.org/software/guile/>
General help using GNU software: <http://www.gnu.org/gethelp/> General help using GNU software: <http://www.gnu.org/gethelp/>
For complete documentation, run: info guile 'Using Guile Tools' For complete documentation, run: info '(guile)Using Guile Tools'
" %guile-bug-report-address)) " %guile-bug-report-address))
(define (module-commentary mod) (define (module-commentary mod)

View file

@ -30,6 +30,7 @@
uint16 int16 uint16 int16
uint32 int32 uint32 int32
uint64 int64 uint64 int64
intptr_t uintptr_t
sizeof alignof sizeof alignof