* NEWS: Update.
* am/bootstrap.am (SOURCES):
* module/Makefile.am (SOURCES): Add system/foreign-library.scm.
* configure.ac: Replace ltdl check with -ldl check.
* libguile/dynl.c: Rewrite to just expose core dlopen / dlsym / etc to a
helper Scheme module.
(scm_dynamic_link, scm_dynamic_pointer, scm_dynamic_function)
(scm_dynamic_object_p, scm_dynamic_call): Rewrite in terms of (system
foreign-library).
* libguile/extensions.c (load_extension): Avoid scm_dynamic_call.
* module/system/foreign-library.scm: New file.
* module/oop/goops.scm (<dynamic-object>): Hackily export
<foreign-library> instead of a class here.
* doc/ref/api-foreign.texi (Foreign Function Interface): Rewrite to only
document the new interfaces. Eventually we will deprecate
dynamic-link and friends.
* doc/ref/guile.texi (API Reference): Move Foreign Objects after Foreign
Function Interface. Seems there should be some closer relationship
but this will do for now.
* doc/ref/tour.texi (Putting Extensions into Modules):
* doc/ref/libguile-parallel.texi (Parallel Installations): Update for
rename of Modules and Extensions to Foreign Extensions.
* libguile/deprecated.h:
* libguile/deprecated.c (scm_dynamic_unlink): Deprecate.
* libguile/guile.c: Remove ltdl include.
* test-suite/tests/foreign.test: Update tests to use new API, and update
error expectations.
* libguile/gen-scmconfig.c (main) [HAVE_PTHREAD_SIGMASK]: new output
define SCM_HAVE_PTHREAD_SIGMASK
* libguile/null-threads.h (scm_i_pthread_sigmask) [SCM_HAVE_PTHREAD_SIGMASK]:
make inline function conditional on existence of pthread_sigmask
* configure.ac (AC_CHECK_FUNCS): add mkdtemp! test
* doc/ref/posix.texi: document mkdtemp!
* libguile/filesys.c (scm_mkdtemp_x): new function
* libguile/filesys.h: new declaration for scm_mkdtemp_x
* test-suite/tests/filesys.test: add tests for mkdtemp!
Adapted from a patch by Rob Browning.
The underlying function was moved to filesys.c in
073167ef7b but the declaration didn't follow
* libguile/filesys.h: add declaration for scm_mkstemp
* libguile/posix.h: remove declaration for scm_mkstemp
* libguile/r6rs-ports.c (scm_i_make_transcoded_ports): make sure to
include SCM_RDNG for input/output ports.
Thanks to Göran Weinholt for reporting the problem.
Closes: 41045
The line, part of the sentence above it in a comment, was accidentally
removed in commit b8d757732f "Rationalize
include order in C files".
* libguile/guile.c: restore missing line.
[rlb@defaultvalue.org: augment commit message; add THANKS]
Closes: 42331
* libguile/srfi-13.c (scm_reverse_list_to_string): Replace string->list
with list->string in the composition explaning how it works. Thanks
to Andrey Ivanov for reporting the problem.
Closes: 34457
* libguile/gc.c (DEFAULT_INITIAL_HEAP_SIZE): Bump a bit farther (2 MB on
64-bit, 1 MB on 32-bit) as we now expand to this size instead of
expanding by this amount.
(scm_storage_prehistory): Expand to the initial heap size instead of
expanding by the size.
* libguile/gc.c (DEFAULT_INITIAL_HEAP_SIZE): Bump to 1.6 MB on 64-bit
targets, or 800 kB on 32-bit targets, to account for increased
footprint. Prevents useless early GC.
(scm_storage_prehistory): Remove unused code to dynamically change the
free space divisor.
* libguile/loader.h (SCM_OBJCODE_MINOR_VERSION): Accept up to version 4.
* module/system/vm/assembler.scm (*bytecode-minor-version*): Produce
version 4.
* doc/ref/vm.texi (Instruction Set, Constant Instructions): Document new
instruction.
* libguile/instructions.c (FOR_EACH_INSTRUCTION_WORD_TYPE): New first
word kind with zi16 operand.
* libguile/jit.c (compile_make_immediate, compile_make_immediate_slow):
New compilers.
(COMPILE_X8_S8_ZI16): New operand kind.
* libguile/vm-engine.c (make-immediate): New instruction.
* module/language/bytecode.scm:
* module/system/vm/assembler.scm (encode-X8_S8_ZI16<-/shuffle):
(signed-bits, load-constant): Support the new instruction kind.
* module/system/vm/disassembler.scm (disassemblers)
(sign-extended-immediate, code-annotation): Support for zi16
operands.
* libguile/read.c (scm_read_string_like_syntax): All characters are
permitted by law; some aren't valid in certain contexts.
* test-suite/tests/reader.test: Replace occurrences of "illegal" by
"invalid".
* test-suite/tests/strings.test: Likewise.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* libguile/loader.h (SCM_OBJCODE_MINOR_VERSION):
* module/system/vm/assembler.scm (*bytecode-minor-version*): Bump, so
that compiled files from Guile 3.0.3 will error when loaded on 3.0.2.
Fixes <https://bugs.gnu.org/41204>.
Reported by Caleb Ristvedt <caleb.ristvedt@cune.org>.
Until now, Guile would leak the file descriptors of all the file ports
not explicitly closed.
* libguile/fports.c (scm_i_fdes_to_port): Initialize fp->revealed.
* test-suite/tests/ports.test ("initial revealed count")
("non-revealed port is closed"): New tests.
("close-port & revealed port"): Check (port-revealed port).
("revealed port fdes not closed"): Likewise.
* libguile/jit.c (UNREACHABLE): New register state.
(unreachable): New predicate.
(ASSERT_HAS_REGISTER_STATE): Succeed when unreachable.
(compile_throw, compile_throw_value, compile_throw_value_and_data):
Set unreachable flag.
(compile_receive_values): Reload FP if needed.
* libguile/bitvectors.h:
* libguile/bitvectors.c (scm_c_bitvector_set_bits_x)
(scm_c_bitvector_clear_bits_x): Expose only C-like interfaces. No
need to have a SCM_UNDEFINED return.
* libguile/deprecated.c (scm_bit_set_star_x): Adapt.
* doc/ref/api-data.texi (Bit Vectors): Update.