1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-16 18:50:23 +02:00
Commit graph

10832 commits

Author SHA1 Message Date
Ludovic Courtès
ef171ff039 Fix unbound variable references in `srfi-19.scm'.
* module/srfi/srfi-19.scm: Use `(ice-9 rdelim)'.
  (date->broken-down-time, priv:year-day, priv:char->int): Fix typo.
  (time-*->time-*, time-*->time-*!): Fix reference to unbound variable
  `caller'.
2009-10-26 19:03:26 +01:00
Neil Jerram
84a54b292d Fix doc for inet-ntop: always produces a string
Thanks to Scott McPeak for reporting this.

* libguile/socket.c (scm_inet_ntop): In docstring, add quotes around
  IPv6 address (+ reflow a bit).

* doc/ref/posix.texi (Network Address Conversion): Corresponding
  change.

* doc/maint/guile.texi: Corresponding change.
2009-10-01 23:44:21 +01:00
Neil Jerram
451e15a06c Fix handling of IPv6 addresses
Thanks to Scott McPeak for reporting this and providing a patch.

* libguile/socket.c (scm_to_ipv6): When address is the wrong type,
  provide more information in the exception message.

  (scm_to_sockaddr): scm_to_ipv6 expects just an address, not the
  whole vector.

* test-suite/tests/socket.test ("AF_INET6/SOCK_STREAM"): New set of
  tests.
2009-10-01 23:43:54 +01:00
Neil Jerram
7394551f61 Fix incorrect doc mentions of INADDR_LOCALHOST
Thanks to Scott McPeak for reporting this.

* doc/ref/posix.texi (Network Sockets and Communication): Change
  INADDR_LOCALHOST to INADDR_LOOPBACK.
2009-10-01 22:29:35 +01:00
Andy Wingo
1bfae3ccf7 bugfix: don't dynamic link if we found a registered extension
* libguile/extensions.c (load_extension): Don't do dynamic linking if we
  actually did find an extension in the list.
2009-09-23 21:35:13 +01:00
Neil Jerram
7496b0397a Fix doc of let*-values
Thanks to Judy Hawkins for reporting this.

* doc/ref/api-modules.texi (Included Guile Modules): Change
  `let-values*' to `let*-values'.
2009-08-27 22:31:50 +01:00
Neil Jerram
7457f712ea Update NEWS 2009-08-21 22:31:09 +01:00
Neil Jerram
e4d87bf9fd Avoid clash with system setjmp/longjmp on IA64
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'.
2009-08-21 22:15:56 +01:00
Ludovic Courtès
40c9875d7c Update `NEWS' for commit d8dd381fa7. 2009-08-17 23:09:16 +02:00
Andy Wingo
d8dd381fa7 fix buffer overrun reading partial numbers: 1.0f, 1.0/, and 1.0+
* libguile/numbers.c (mem2decimal_from_point, mem2ureal, mem2complex):
  Fix a number of cases where, for invalid numbers, we could read past
  the end of the buffer. This happened in e.g. "1.0+", "1/" and "1.0f".
  But I couldn't figure out how to test for these, given that the
  behavior depended on the contents of uninitialized memory in the
  reader buffer. We'll just have to be happy with this.

Thanks to Kjetil S. Matheussen for the report.
2009-08-04 20:32:51 +02:00
Ludovic Courtès
240a7800d0 Bump version number for 1.8.7.
* GUILE-VERSION (GUILE_MICRO_VERSION): Increment.
  (LIBGUILE_INTERFACE_REVISION): Increment.
2009-07-05 22:23:15 +02:00
Ludovic Courtès
015573ca9e Update `NEWS'.
* NEWS: Update.
2009-07-05 22:19:30 +02:00
Ludovic Courtès
85955347ba Enclose `bit-operations.test' in its own module.
* test-suite/tests/bit-operations.test: Use the `define-module' clause.
2009-07-05 21:13:51 +02:00
Ludovic Courtès
de8ab91a76 Work around the lack of a vsnprintf(3) declaration on AIX 5.3.
* configure.in: Check for the vsnprintf(3) declaration.

* libguile/deprecation.c [!HAVE_DECL_VSNPRINTF]: Provide vsnprintf(3)
  declaration.  This is needed on `powerpc-ibm-aix5.3.0.0'.
2009-07-05 21:13:02 +02:00
Ludovic Courtès
7747b2d4f0 Fix the `BUILD_PTHREAD_SUPPORT' Automake conditional when not using pthread.
* configure.in: Set $build_pthread_support to "no" when thread support
  isn't built.  This fixes the `BUILD_PTHREAD_SUPPORT' Automake
  conditional.
2009-07-05 21:10:35 +02:00
Ludovic Courtès
3cd9d9bae2 Aggregate makefiles under `ice-9'.
* configure.in: Remove `ice-9/{debugger,debugging}/Makefile' from
  `AC_CONFIG_FILES'.

* ice-9/Makefile.am (SUBDIRS): Remove.
  (ice9_debugger_sources, ice9_debugging_sources): New variables.
  (subpkgdata_DATA): Remove
  (nobase_subpkgdata_DATA): New.
  (TAGS_FILES): Point to $(nobase_subpkgdata_DATA).
  (EXTRA_DIST): Add `$(ice9_debugger_sources) $(ice9_debugging_sources)'.
2009-07-04 01:57:44 +02:00
Neil Jerram
9f6b657549 Update NEWS' and README' to cover MinGW cross-compiling
Also
- removed the completely content-free `Special Instructions For Some
  Systems' section from `README'
- changed the version number in `README' to 1.8.7.
2009-07-04 00:33:05 +01:00
Neil Jerram
51f465a948 Revert "Add libguile to the subdirs where pre-inst-guile* looks for libraries"
This reverts commit b6c09de56a.

Sorry, 1.8/master confusion on my part.  Thanks to Ludovic for
explaining why this commit isn't needed.
(http://lists.gnu.org/archive/html/guile-devel/2009-07/msg00001.html)
2009-07-01 23:15:10 +01:00
Neil Jerram
04f9bc774a Read complex numbers where both parts are inexact decimals
Thanks to Bill Schottstaedt for reporting this problem!

* libguile/numbers.c (mem2ureal): Don't be misled by *p_exactness
  being INEXACT on entry (as is possible when reading a complex
  number): use local exactness variable x which starts as EXACT.
  Call mem2decimal_from_point () with &x instead of p_exactness.

* test-suite/tests/numbers.test ("string->number"): Add complex number
  tests suggested by Bill.
2009-07-01 01:41:25 +01:00
Neil Jerram
c7c36fcf40 Correction to doc on Accessing Arrays from C
Thanks to Ludovic for the new wording!

* doc/ref/api-compound.texi (Accessing Arrays from C): Correct text to
  reflect the current implementation of scm_array_get_handle and
  scm_array_handle_release - which don't actuall do any dynwind stuff.
2009-06-30 23:56:40 +01:00
Neil Jerram
0ed755ba58 URL missing from previous commit message
http://www.mail-archive.com/guile-devel@gnu.org/msg01635.html

(Second time this has happened.  I don't know why!)
2009-06-30 23:32:53 +01:00
Neil Jerram
b6c09de56a Add libguile to the subdirs where pre-inst-guile* looks for libraries
This fixes a problem on some platforms where a pre-inst guile
incorrectly picks up an old installed library (e.g. from
/usr/local/lib) instead of the not-yet-installed newly built library.

For detailed discussion see
and
http://www.mail-archive.com/guile-devel@gnu.org/msg02529.html.

* pre-inst-guile-env.in (subdirs_with_ltlibs): Add libguile.

* pre-inst-guile.in (subdirs_with_ltlibs): Add libguile.
2009-06-30 23:31:11 +01:00
Neil Jerram
9d9a58e184 For MinGW hide exported struct variables behind pointers
MinGW apparently can't export/import struct variables from/to a DLL,
so wrap the ones needed by inline.h in exported/imported pointer
variables.

All of the following changes apply to a MinGW build only.

* libguile/gc-freelist.c (scm_i_master_freelist_ptr,
  scm_i_master_freelist2_ptr): New API variables.

* libguile/gc.h (scm_i_freelist_ptr, scm_i_freelist2_ptr,
  scm_i_master_freelist_ptr, scm_i_master_freelist2_ptr): New global
  variable declarations.

* libguile/inline.h (scm_cell): Use scm_i_freelist_ptr and
  scm_i_master_freelist_ptr instead of scm_i_freelist and
  scm_i_master_freelist.
  (scm_double_cell): Use scm_i_freelist2_ptr and
  scm_i_master_freelist2_ptr instead of scm_i_freelist2 and
  scm_i_master_freelist2.

* libguile/threads.c (scm_i_freelist_ptr, scm_i_freelist2_ptr): New
  global variables.
2009-06-29 21:15:12 +01:00
Neil Jerram
954d46413f Use GUILE_FOR_BUILD for autogeneration steps during the build
This is a fix for a MinGW cross compile build.

* doc/ref/Makefile.am (autoconf-macros.texi): Use GUILE_FOR_BUILD to
  generate this.
2009-06-29 21:15:12 +01:00
Neil Jerram
c00be3d85d srfi-60.c shouldn't include private-gc.h
* srfi/srfi-60.c (SCM_MIN): Define here instead of including
  private-gc.h.
2009-06-29 21:15:11 +01:00
Neil Jerram
f450c2c06e In MinGW build, avoid clash between libguile and SRFI library function names
The dummy scm_init_* and scm_c_init_* functions in the empty libraries
for SRFIs 4, 13 and 14 clash with declarations with the same names in
libguile.h that are marked (in the MinGW build) with __declspec
(dllimport).  These libraries are empty because their content was
moved into libguile some time ago, and I think these functions are
needed only so that the libraries appear to contain something.  They
used also to be needed for the (load-extension ...)  forms in the
corresponding .scm modules, but those forms were not needed anymore,
and so were removed, when everything moved into libguile.

* srfi/srfi-13.c (scm_init_srfi_13_no_clash_with_libguile): Renamed
  from scm_init_srfi_13.
  (scm_init_srfi_13_14_no_clash_with_libguile): Same.

* srfi/srfi-14.c (scm_init_srfi_14_no_clash_with_libguile): Same.
  (scm_c_init_srfi_14_no_clash_with_libguile): Same.

* srfi/srfi-4.c (scm_init_srfi_4_no_clash_with_libguile): Same.
2009-06-29 21:03:45 +01:00
Neil Jerram
a73225dd61 Revert "* FAQ: New file."
This reverts commit 0b3d52fae1.

It was a confusing mistake to create an FAQ file in the Guile
repository/distribution, because there was already an FAQ page on the
Guile web site.  The information that was in the FAQ file is now in
the FAQ web page.
2009-06-25 23:16:56 +01:00
Neil Jerram
8510e39278 Remove GDB_INTERFACE stuff from guile's main program
The main motivation for this is wanting a successful MinGW build,
which is currently failing with:

guile-guile.o: In function `inner_main':
/home/neil/SW/Guile/ovnight/libguile/guile.c:55: undefined reference to `__imp__gdb_result'
/home/neil/SW/Guile/ovnight/libguile/guile.c:55: undefined reference to `__imp__gdb_output'
/home/neil/SW/Guile/ovnight/libguile/guile.c:55: undefined reference to `__imp__gdb_output_length'

The detailed problem here is to do with how those variables are
declared as exported from the libguile DLL and imported by the guile.c
main program.  But in fact we don't need to solve that problem because
the GDB interface is an idea that never actually happened.  So here we
just remove the offending variable references from guile.c.

For the record, Guile contains two kinds of GDB support, one of which
is real (and works, last time I tried it), and the other mythical.

The first kind is that libguile includes the utility functions
gdb_print, gdb_eval, etc., and the variable gdb_output.  These have no
purpose except for developers to use from GDB when debugging
something.  For example, if you have a SCM x and want to know what it
is, you can do:

(gdb) call gdb_print(x)
(gdb) p gdb_output

The second kind is that those utility functions are somehow declared
to GDB, and then GDB itself uses/calls them in some useful way.  This
was an interesting idea, but (AFAICT) never actually happened.

I think it's worth leaving gdb_interface.h in the repository and the
distribution, in case this idea is properly resurrected in the future.

* libguile/guile.c (top level): Remove GDB_INTERFACE declaration.
  (inner_main): Remove GDB_INTERFACE_INIT call.
2009-06-25 21:40:32 +01:00
Neil Jerram
0367cb9d56 Fix MinGW build warning caused by tzname redeclaration
The warning is:
stime.c:85: warning: `tzname' redeclared without dllimport attribute: previous dllimport ignored

The second half of this section of #ifdefery implies that the MinGW
build isn't going to reference a function called `tzname' anyway
(because it's going to use `_tzname' instead).  So why should a MinGW
build want any declaration of `tzname' at all?

As far as a declaration of `_tzname' is concerned, there are no
more #includes after this, so we must have already got a declaration
of `_tzname' from one of the preceding includes.

* libguile/stime.c (tzname): Remove declaration in __MINGW32__ build.
  It isn't needed and causes a build warning.
2009-06-21 17:46:07 +01:00
Neil Jerram
a5cb530502 Thank Sylvain 2009-06-18 21:01:09 +01:00
Neil Jerram
3548c338b2 URL omitted from the previous commit message...
Should have said:
The readline part of this goes back to this problem report:
http://sources.redhat.com/ml/guile/2000-05/msg00177.html; and is an
excellent example...
2009-06-18 20:56:54 +01:00
Neil Jerram
5e9dc714ca Remove AC_SYS_RESTARTABLE_SYSCALLS and related code
As the Autoconf documentation says, "These days portable programs
[...] should not rely on `HAVE_RESTARTABLE_SYSCALLS', since nowadays
whether a system call is restartable is a dynamic issue, not a
configuration-time issue."

In other words, if we ever rely on HAVE_RESTARTABLE_SYSCALLS, we are
at the mercy of any code that Guile happens to be linked with, because
that code could install a signal handler without the SA_RESTART flag,
and then a Guile system call could unexpectedly return EINTR.

The readline part of this goes back to this problem report:
excellent example of the above paragraph.  It was noted during the
discussion that undefining HAVE_RESTARTABLE_SYSCALLS would fix the
problem, but that solution wasn't adopted - I guess because Guile was
still using cooperative threads then (not pthreads) and so there was a
significant concern (whether founded or not) that not using
restartable syscalls (where available) could lead to a loss of
performance.

Now Guile's default mode of operation is with pthreads, where we
already don't assume that HAVE_RESTARTABLE_SYSCALLS is reliable, so
there is no possible further performance loss.  And in any case we
really have no choice, if we want correct operation.

* configure.in (AC_SYS_RESTARTABLE_SYSCALLS): Removed.

* doc/ref/posix.texi (Signals): Remove statement that Guile always
  sets SA_RESTART flag.

* guile-readline/configure.in (GUILE_SIGWINCH_SA_RESTART_CLEARED):
  Remove this setting, together with its test code.
  (HAVE_RL_PRE_INPUT_HOOK): Remove this setting and its code, as no
  longer needed.

* guile-readline/readline.c (sigwinch_enable_restart): Removed.
  (scm_init_readline): Remove setting of rl_pre_input_hook.

* libguile/_scm.h (SCM_SYSCALL): Remove the definition that relies on
  HAVE_RESTARTABLE_SYSCALLS.

* libguile/scmsigs.c (scm_sigaction_for_thread): Don't always set the
  SA_RESTART flag if available.  Update docstring accordingly.
  (scm_init_scmsigs): Remove code that sets SA_RESTART flag for all
  signals.
2009-06-18 20:35:45 +01:00
Neil Jerram
d2cb6b102b Fix popen.test on NetBSD and Ubuntu Jaunty, where sh is not Bash
Thanks to Greg Troxel for reporting, and Barry Fishman for the
explanation and fix.

* test-suite/tests/popen.test ("open-input-pipe"): Use shell function
  `read' with an explicit argument, as apparently not all shells
  support read with no argument.
2009-06-06 00:08:30 +01:00
Neil Jerram
66f3b6c1b0 Remove possible deadlock in scm_join_thread
* libguile/threads.c (scm_join_thread): Always recheck t->exited
  before calling block_self again, in case thread t has now exited.

* test-suite/tests/threads.test (joining): New test.
2009-05-20 21:56:17 +01:00
Neil Jerram
3ed47d2203 Avoid "no duplicate" popen tests leaving zombie processes
On the one hand we want the child process in these tests to exit.  On
the other, we don't want it to exit before the parent Guile code has
tested the relevant condition (EOF in the first test, broken pipe in
the second) - because these conditions would obviously be true if the
child had already exited, and that's not what we're trying to test
here.  We're trying to test getting EOF and broken pipe while the
child process is still alive.

* test-suite/tests/popen.test (open-input-pipe:no duplicate): Add
  another pipe from parent to child, so that the child can finish by
  reading from this.  Then the parent controls the child lifetime by
  writing to this pipe.

* test-suite/tests/popen.test (open-output-pipe:no duplicate): Add
  another pipe from child to parent, and have the child finish by
  endlessly writing into this.  Then the parent controls the child
  lifetime by closing its end of the pipe, causing a broken pipe in
  the child.
2009-05-20 19:05:38 +01:00
Neil Jerram
0310b348a1 Fix explicitely' typos, should be explicitly' 2009-05-20 18:54:23 +01:00
Ludovic Courtès
4a198038b9 Update `NEWS'. 2009-05-12 00:12:18 +02:00
Michael Gran
93c0c75658 Symbols longer than 128 chars can cause an exception. Also, the terminating colon of long postfix keywords are not handled correctly.
* test-suite/tests/reader.test ("read-options"): Add test
	for long postfix keywords.

	* libguile/read.c (scm_read_mixed_case_symbol): Fix
	exception on symbols are greater than 128 chars.  Also,
	colons are not stripped from long postfix keywords.
2009-05-12 00:07:51 +02:00
Ludovic Courtès
1011599792 Better diagnose broken (strftime "%z" ...)' in time.test' (bug #24130).
* test-suite/tests/time.test ("strftime")["C99 %z
  format"](have-strftime-%z): Better diagnose broken "%z" on Tru64 5.1b
  and AIX.  Closes bug #24130.

* NEWS: Update.
2009-05-12 00:01:30 +02:00
Ludovic Courtès
5d8f339fd8 Work around lack of flock(2) declaration on Tru64 5.1b.
* configure.in: Check for the declaration of flock(2).

* libguile/posix.c [!__MINGW32__][!HAVE_DECL_FLOCK]: Provide an flock(2)
  declaration, needed on Tru64 5.1b.
2009-05-11 22:54:45 +02:00
Ludovic Courtès
2b76a65566 Fix compilation of `test-round.c' on BSD.
* test-suite/standalone/test-round.c (HAVE_MACHINE_FPU_H): Include
  <sys/types.h> when available.  This fixes compilation on NetBSD.
  Reported by Greg Toxel.
2009-05-11 22:13:29 +02:00
Ludovic Courtès
cabfe198fd Ask for IEEE floating point behavior on Alpha and SH.
* configure.in (CPPFLAGS): Add `-mieee' or `-ieee' on Alpha and SH.

* libguile/numbers.c (guile_ieee_init): Make sure `-mieee' was passed
  when using GCC on Alpha.

* NEWS: Update.
2009-05-11 22:11:25 +02:00
Ludovic Courtès
e9c9fd3d99 Update `NEWS'. 2009-04-24 00:44:43 +02:00
Ludovic Courtès
b701fcef1d Don't use raw divisions by zero in `test-conversion.c'.
* test-suite/standalone/test-conversion.c (ieee_init): New function.
  (guile_Inf, guile_NaN): New variables.
  (test_from_double, test_to_double): Use them.  Divisions by zero made
  `cc' on Tru64 5.1b ("Compaq C V6.5-011") bail out and led to a
  floating point exception when compiled with GCC on the same platform.
  (main): Call `ieee_init ()'.
2009-04-23 23:20:59 +02:00
Ludovic Courtès
c50764e72e Use <machine/fpu.h> instead of <fenv.h> when needed (e.g., Tru64 5.1b).
* configure.in: Look for <machine/fpu.h>.

* test-suite/standalone/test-round.c: Use <machine/fpu.h> if available.
2009-04-23 22:51:27 +02:00
Ludovic Courtès
fbcc27cfef Work around lack of cuserid(3) declaration on Tru64 5.1b.
* configure.in: Check for a cuserid(3) declaration.

* libguile/posix.c [HAVE_CUSERID][!HAVE_DECL_CUSERID]: Provide a
  declaration.
2009-04-23 22:24:32 +02:00
Ludovic Courtès
d2469ca702 Work around the lack of hstrerror(3) declaration on Tru64.
* configure.in: Look for the declaration of hstrerror(3).

* libguile/net_db.c: Add hstrerror(3) declaration if
  `HAVE_DECL_HSTRERROR' is undefined.
2009-04-23 22:04:05 +02:00
Ludovic Courtès
df2870d385 Fix use of unsetenv(3) on Tru64.
* configure.in: Check for the declaration of unsetenv(3), which Tru64
  5.1b doesn't have.

* libguile/posix.c: Include <stdlib.h> since that's where POSIX says
  unsetenv(3) should reside.
  (scm_putenv): Don't attempt to use unsetenv(3) if its declaration
  isn't available since that wouldn't work well on Tru64.
2009-04-23 22:00:44 +02:00
Ludovic Courtès
5260808c9d Remove extraneous semicolons from `test-conversion.c'.
* test-suite/standalone/test-conversion.c: Remove extraneous semicolon
  following `DEF[SU]TST' invocations since that made Compaq C
  V6.5-011 (`cc' on Tru64 5.1b) bail out.
2009-04-22 23:53:52 +02:00
Ludovic Courtès
ceb6da3f8b Fix compilation of `numbers.c' on Tru64.
* libguile/numbers.c (scm_c_make_polar): Don't use sincos(3) on non-GNU
  platforms.  Reported by Didier Godefroy <ldg@ulysium.net>.
2009-04-21 22:37:45 +02:00