1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 20:00:19 +02:00
Commit graph

16114 commits

Author SHA1 Message Date
Andy Wingo
7e369c3899 remove mingw32 implementations of {get,end,set}{serv,proto}ent
* libguile/win32-socket.h:
* libguile/win32-socket.c (getservent, endservent, setservent)
  (getprotoent, endprotoent, setprotoent): Remove mingw32 wrappers.
  Their place is in gnulib, if anywhere.
2013-03-09 15:56:30 +01:00
Andy Wingo
4c187d46d4 add check for struct pollfd
* configure.ac: Add check for struct pollfd.

* libguile/fports.c (fport_input_waiting):
* libguile/poll.c (scm_primitive_poll): Require struct pollfd.  Fixes
  bug 13903.
2013-03-09 11:56:56 +01:00
Andy Wingo
19113f1ca7 allow case-lambda expressions with no clauses
* module/ice-9/psyntax-pp.scm:
* module/ice-9/psyntax.scm (case-lambda, case-lambda*): Allow 0
  clauses.

* module/language/scheme/decompile-tree-il.scm (do-decompile):
  (choose-output-names):
* module/language/tree-il.scm (unparse-tree-il):
  (tree-il-fold, post-order!, pre-order!):
* module/language/tree-il/effects.scm (make-effects-analyzer):
* module/language/tree-il/cse.scm (cse):
* module/language/tree-il/debug.scm (verify-tree-il):
* module/language/tree-il/peval.scm (peval): Allow for lambda-body to be
  #f.

* libguile/memoize.c (memoize):
* module/language/tree-il/canonicalize.scm (canonicalize!): Give a body
  to empty case-lambda before evaluating it or compiling it,
  respectively.

* test-suite/tests/optargs.test ("case-lambda", "case-lambda*"): Add
  tests.
2013-03-09 11:16:31 +01:00
Andy Wingo
9ddf06dcee fix in-tree guile reference
* meta/guile.in (GUILE): Add @EXEEXT@ for libguile/guile reference, for
  MinGW compiles.
2013-03-09 10:29:57 +01:00
Mark H Weaver
929d11b2c1 Improve standards conformance of string->number.
Fixes <http://bugs.gnu.org/11887>.

* libguile/numbers.c (mem2ureal): New argument 'allow_inf_or_nan'.
  Accept infinities and NaNs only if 'allow_inf_or_nan' is true and "#e"
  is not present.  Check for "inf.0" or "nan." case-insensitively.  Do
  not accept rationals with zero divisors.

  (mem2complex): Pass new 'allow_inf_or_nan' argument to 'mem2ureal',
  which is set if and only if a explicit sign was present.

* test-suite/tests/numbers.test ("string->number"): Add tests.
2013-03-07 15:37:15 -05:00
Stefan Israelsson Tampe
aab9d46c83 add GUILE_STACK_SIZE environment variable
* libguile/vm.c (initialize_default_stack_size): New helper.
  (scm_bootstrap_vm): Call initialize_default_stack_size.

* doc/ref/guile-invoke.texi (Environment Variables): Add docs.

Based on a patch by Stefan Israelsson Tampe.
2013-03-07 14:25:36 +01:00
Andy Wingo
d0ecf8eb9e support calls and tail-calls with more than 255 formals
* module/language/tree-il/compile-glil.scm (flatten-lambda-case):
  Support calls and tail-calls with more than 255 formals.

* test-suite/tests/tree-il.test ("many args"): Add a test.
2013-03-07 13:59:18 +01:00
Andy Wingo
8d48877d2c ,option evaluates its right-hand-side
* doc/ref/scheme-using.texi (System Commands): Better documentation for
  ,option.

* module/system/repl/command.scm (option): Evaluate the RHS when setting
  an option.  Fixes bug 13076.
2013-03-07 11:29:01 +01:00
Andy Wingo
83dce818ec GUILE_INSTALL_LOCALE=1 during build
* doc/ref/Makefile.am (autoconf-macros.texi):
* libguile/Makefile.am (snarf2checkedtexi):
* module/Makefile.am (ice-9/psyntax-pp.scm.gen, ice-9/psyntax-pp.go):
* test-suite/Makefile.am (GUILE_AUTO_COMPILE):
* test-suite/standalone/Makefile.am (GUILE_INSTALL_LOCALE):
* test-suite/vm/Makefile.am (TESTS_ENVIRONMENT):
* am/guilec (.scm.go): Set GUILE_INSTALL_LOCALE to 1 during the build.
  Fixes bug 12887.
2013-03-07 11:02:33 +01:00
Ludovic Courtès
7f893030ab Install the current locale if GUILE_INSTALL_LOCALE is nonzero.
* libguile/guile.c (get_integer_from_environment)
  (should_install_locale): New functions.
  (main): Add `setlocale' call.

* doc/ref/guile-invoke.texi (Environment Variables): Add documentation.
2013-03-07 10:48:44 +01:00
Andy Wingo
1b787ef9ec structs with tail arrays are not simple
* libguile/struct.h (SCM_VTABLE_FLAG_SIMPLE, SCM_VTABLE_FLAG_SIMPLE_RW):
* libguile/struct.c (set_vtable_layout_flags): Vtable whose layouts
  include a tail array are not simple.  Fixes bug 12808.
2013-03-07 07:52:00 +01:00
Andy Wingo
e20cec744f fix compilation under mingw
* libguile/load.c (is_absolute_file_name, search_path): Fix compilation
  under mingw.
2013-03-07 07:52:00 +01:00
Ludovic Courtès
6db7ee7b3a Make `SCM_LONG_BIT' usable in preprocessor conditionals.
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.
2013-03-07 00:05:46 +01:00
Ludovic Courtès
e6a7a86d7e Use `scm_is_eq' in load.c.
* libguile/load.c (is_file_name_separator): Use `scm_is_eq' instead of `=='.
2013-03-07 00:05:46 +01:00
Ludovic Courtès
0c8a2c380d doc: Allow compilation of r5rs.texi with Texinfo 5.0.
* doc/r5rs/r5rs.texi: Remove extraneous @author.  Change @unnumbered to
  @majorheading within @titlepage.
2013-03-07 00:05:46 +01:00
Mark H Weaver
cba521fe42 Verify that FLT_RADIX is 2.
* libguile/numbers.c: Trigger a compilation error if FLT_RADIX is not 2.
  This has long been assumed by code in numbers.c.
2013-03-06 15:32:01 -05:00
Mark H Weaver
a2dead1b0f Improve code in scm_gcd for inum/inum case
* libguile/numbers.c (scm_gcd): Improve implementation of inum/inum case
  to be more clear and efficient.
2013-03-06 15:02:26 -05:00
Mark H Weaver
f57ea23ac8 Fix thread-unsafe lazy initializations.
* libguile/debug.c (scm_local_eval):
  libguile/ports.c (scm_current_warning_port):
  libguile/strports.c (scm_eval_string_in_module): Perform
  lazy-initialization while holding a mutex.  Use SCM_UNDEFINED as the
  uninitialized value.  Use 'scm_c_*_variable'.

* doc/ref/api-modules.texi (Accessing Modules from C): Fix
  'my_eval_string' example to be thread-safe.
2013-03-05 16:04:55 -05:00
Ludovic Courtès
29ace173b1 doc: Rename "Texinfo" node to "Texinfo Processing".
* doc/ref/texinfo.texi (Texinfo): Rename to...
  (Texinfo Processing): ... this.
* doc/ref/guile.texi (Guile Modules): Update menu.
2013-03-04 09:04:16 +01:00
Ludovic Courtès
69b6da07c3 Use `scm_is_eq' in filesys.c.
* libguile/filesys.c (is_file_name_separator): Use `scm_is_eq' instead
  of `=='.  Fixes <http://hydra.nixos.org/build/4261579>.
2013-03-04 08:57:08 +01:00
Bake Timmons
994d87be35 Improve keyword notation of Texinfo function definitions.
* doc/ref/api-debug.texi:
* doc/ref/api-evaluation.texi:
* doc/ref/api-modules.texi:
* doc/ref/compiler.texi:
* doc/ref/web.texi: Make Texinfo function headers more consistent.
  Change lesser used keyword notation to the predominant form.

* doc/ref/api-procedures.texi: Fix an argument name in a header that should
  use repeated argument notation.

* doc/ref/srfi-modules.texi: Update references in Texinfo function
  definition body to match previously updated variable notation in
  definition header.
2013-03-02 20:34:29 +01:00
Ludovic Courtès
183d2ace57 doc: Fix build with Texinfo 5.0.
* doc/ref/api-control.texi (Handling Errors): Move misplaced description
  for `scm_memory_error' & co.
* doc/ref/r6rs.texi (rnrs base): Change `deffnx' of `let-syntax' and
  `letrec-syntax' to fit on one line.
2013-03-01 17:50:05 +01:00
Ludovic Courtès
01b69e79f6 Allow the SMOB mark procedures to be called when libgc uses parallel markers.
Fixes <http://bugs.gnu.org/13611>.
Reported by Mike Gran <spk121@yahoo.com>.

* libguile/smob.c (current_mark_stack_pointer,
  current_mark_stack_limit): New variables.
  (smob_mark): Use CURRENT_MARK_STACK_POINTER and
  CURRENT_MARK_STACK_LIMIT instead of the same-named fields of
  `SCM_I_CURRENT_THREAD'.
  (scm_gc_mark): Likewise.
  (scm_smob_prehistory): Initialize CURRENT_MARK_STACK_LIMIT and
  CURRENT_MARK_STACK_POINTER.
* libguile/threads.h (scm_i_thread): Add comment that
  `current_mark_stack_ptr' and `current_mark_stack_limit' are no longer
  used.
2013-03-01 17:50:05 +01:00
Ludovic Courtès
0f595d7d1d Use accessors instead of symbols deprecated in libgc 7.3.
* configure.ac: Check for `GC_set_all_interior_pointers',
  `GC_get_gc_no', and `GC_set_java_finalization'.
* libguile/gc.c (scm_gc_stats)[HAVE_GC_GET_GC_NO]: Use `GC_get_gc_no'.
  (scm_storage_prehistory)[HAVE_GC_SET_ALL_INTERIOR_POINTERS]: Use
  `GC_set_all_interior_pointers'.
* libguile/guardians.c (scm_init_guardians)[HAVE_GC_SET_JAVA_FINALIZATION]:
  Use `GC_set_java_finalization'.
2013-03-01 17:50:05 +01:00
Daniel Hartwig
764246cfbb test-suite: eq-ness of numbers, characters is unspecified
* test-suite/tests/00-socket.test:
* test-suite/tests/alist.test:
* test-suite/tests/elisp.test:
* test-suite/tests/encoding-iso88591.test:
* test-suite/tests/encoding-iso88597.test:
* test-suite/tests/encoding-utf8.test:
* test-suite/tests/hash.test:
* test-suite/tests/i18n.test:
* test-suite/tests/modules.test:
* test-suite/tests/ports.test:
* test-suite/tests/srfi-35.test: Make tests use eqv? instead of eq? when
  comparing numbers, characters.  Checked also for similar uses of
  assq[-ref].

* test-suite/tests/vlist.test ("vhash-delete honors HASH"): Change test
  to use eqv-ness, not eq-ness, which should not impact its purpose as
  these two are equivalent for strings.
2013-03-01 11:03:22 -05:00
Mark H Weaver
8dd01861a9 Fix later-bindings-win logic in with-fluids.
Based on a patch by David Kastrup <dak@gnu.org>.
Fixes <http://bugs.gnu.org/13843>.

* libguile/fluids.c (scm_i_make_with_fluids): Reverse direction of inner
  loop that checks for duplicates, to properly handle more than two
  bindings to the same fluid.
2013-02-28 18:43:09 -05:00
Mark H Weaver
b8d8f8b929 Fix duplicate removal of with-fluids.
Based on a patch by David Kastrup <dak@gnu.org>.
Fixes <http://bugs.gnu.org/13838>.

* libguile/fluids.c (scm_i_make_with_fluids): Remove the duplicate
  binding instead of the last binding.

* test-suite/tests/fluids.test: Add test, and fix existing duplicate
  tests.

* THANKS: Thanks David Kastrup.
2013-02-28 06:26:22 -05:00
Mark H Weaver
5ccc3764b3 Support calling foreign functions of 10 arguments or more.
* libguile/foreign.c (OBJCODE_HEADER, META_HEADER, META): Change these
  into higher-order macros.
  (GEN_CODE): New higher-order macro based on 'CODE'.
  (M_STATIC, M_DYNAMIC): New macros.
  (CODE): Reimplement using 'GEN_CODE' and 'M_STATIC'.
  (make_objcode_trampoline): New static function.
  (large_objcode_trampolines, large_objcode_trampolines_mutex): New
  static variables.
  (get_objcode_trampoline): New static function.
  (cif_to_procedure): Use 'get_objcode_trampoline'.

* test-suite/standalone/test-ffi-lib.c (test_ffi_sum_many):
  New function.

* test-suite/standalone/test-ffi: Add test.
2013-02-28 04:11:35 -05:00
Ludovic Courtès
aacc689677 Fix handling of the *-gnux32 target.
* module/system/base/target.scm (triplet-pointer-size): Fix typo in the
  x32 triplet name.
* test-suite/tests/asm-to-bytecode.test (native-os): New procedure.
  (test-target): Use (native-word-size) only when both the CPU and OS
  match.
2013-02-28 09:42:45 +01:00
David Kastrup
a5d8f98c60 Let reverse! accept arbitrary types as second argument (new_tail)
* libguile/list.c (scm_reverse_x): remove typecheck for 2nd arg.

Signed-off-by: Mark H Weaver <mhw@netris.org>
2013-02-27 20:46:58 -05:00
Ludovic Courtès
b946e08a6a Recognize the `x86_64.*-gnux32' triplet.
* module/system/base/target.scm (triplet-pointer-size): Add case for
  "^x64_64-.*-gnux32".
* test-suite/tests/asm-to-bytecode.test ("cross-compilation"):
  ["x86_64-unknown-linux-gnux32"]: New test.
2013-02-27 20:40:08 +01:00
Ludovic Courtès
9130ec74cf Check whether a triplet's OS part specifies an ABI.
* module/system/base/target.scm (cpu-word-size): Rename to...
  (triplet-pointer-size): ... this.  Update caller.  Take a triplet as
  the argument.  Check the `triplet-os' part when checking for equality
  with the host.  Add support "mips64.*-gnuabi64".
* test-suite/tests/asm-to-bytecode.test ("cross-compilation")
  [ "mips64el-unknown-linux-gnuabi64"]: New test.
2013-02-27 20:40:08 +01:00
Ludovic Courtès
cc2948aa31 Recognize mips64* as having 32-bit pointers by default.
* module/system/base/target.scm (cpu-word-size): Consider MIPS64 to
  default to n32 or o32.
* test-suite/tests/asm-to-bytecode.test ("cross-compilation")
  ["mips64el-unknown-linux-gnu"]: New test.
2013-02-27 20:40:08 +01:00
Ludovic Courtès
4124994771 tests: Avoid missing missing-prototype warning with <fenv.h> on glibc 2.17.
* test-suite/standalone/test-round.c: Avoid missing-prototype warning
  with <fenv.h> on glibc 2.17.
2013-02-27 20:40:07 +01:00
Ludovic Courtès
94a7029acf Fix cross-compilation of `c-tokenize.o'.
* libguile/Makefile.am (c-tokenize.$(OBJEXT)): Pass -I$(top_builddir)
  when cross-compiling.
2013-02-27 20:40:07 +01:00
Mark H Weaver
be6a36a05d Update copyright dates on random.c
* libguile/random.c: Add 2012 and 2013 to the copyright notice.
2013-02-25 22:14:41 -05:00
Mark H Weaver
587f4edd39 random_state_of_last_resort: use getpid directly, instead of scm_getpid
* libguile/random.c: Include <sys/types.h> and <unistd.h> (if present).
  (random_state_of_last_resort): Use getpid directly.
2013-02-25 13:53:49 -05:00
Mark H Weaver
3ec19a7884 Revert "random_state_of_last_resort doesn't rely on HAVE_POSIX"
This reverts commit eaf21539d4.
2013-02-25 13:33:28 -05:00
Mark H Weaver
444b26f739 Revert "random-state-from-platform: simplify pid conditional, and clarify docs."
This reverts commit 08904661a2.
2013-02-25 13:33:14 -05:00
Mark H Weaver
08904661a2 random-state-from-platform: simplify pid conditional, and clarify docs.
* libguile/random.c (random_state_of_last_resort): Simplify optional
  inclusion of PID in the random state.  Clarify in the comments that
  the PID is only included where scm_getpid is present.

* doc/ref/api-data.texi (Random): Clarify that
  'random-state-from-platform' includes the PID in the random state only
  if scm_getpid is present.
2013-02-24 19:57:00 -05:00
Andy Wingo
c085589b1c remove language/glil/decompile-assembly.scm
* module/language/glil/decompile-assembly.scm: Remove.  This module
  never worked, and even failed to compile.

* module/language/glil/spec.scm:
* module/Makefile.am: Remove references to (language glil
  decompile-assembly).
2013-02-24 15:50:09 +01:00
Andy Wingo
72ad03fcbd deprecate (ice-9 mapping)
* module/ice-9/mapping.scm: Add deprecation warning.
2013-02-24 15:11:14 +01:00
Daniel Hartwig
1746b8ffdb fix and update (ice-9 mapping)
* module/ice-9/mapping.scm (mapping-create-handle!): INIT is required.
  (mapping-ref): Rewrite.  Fix problem with DFLT.
  (hash-table-mapping-hooks): Drop DELETE-PROC, hash-table accessors
  only use ASSOC-PROC.  Add INIT to create-handle hook.  Use correct
  hash-table accessors.
  (make-hash-table-mapping): Drop DELETE-PROC.
  (hash-table-mapping): Rewrite.  Drop DELETE-PROC.
2013-02-24 14:41:56 +01:00
Andy Wingo
7a17979ea4 cleanup to filesys.c's handling of file name separators
* libguile/filesys.c (is_file_name_separator): New helper, as in
  load.c.
  (scm_dirname, scm_basename, scm_i_relativize_path): Use
  is_file_name_separator.
2013-02-24 14:20:18 +01:00
Andy Wingo
c21939bc24 simplify scm_stat on mingw
* libguile/filesys.c (scm_stat): Don't munge the filename on MinGW;
  gnulib does that for us.
2013-02-24 14:18:29 +01:00
Andy Wingo
4bab7f01be load.c uses same logic as boot-9 for file names
* libguile/load.c (is_file_name_separator, is_drive_letter):
  (is_absolute_file_name): New helpers, like the ones in boot-9.
  Perhaps we should just define them in C.
  (search_path, scm_try_auto_compile, canonical_suffix): Rewrite using
  the new helpers.
2013-02-24 14:18:27 +01:00
Andy Wingo
65fa392306 allow '/' in the prefix of UNC file names on windows
* module/ice-9/boot-9.scm (absolute-file-name?) [WINDOWS]: Allow '/' as
  well as '\' when detecting UNC names.
  (load-in-vicinity): Add a comment about the purpose of
  canonical->suffix.
2013-02-24 13:03:42 +01:00
Andy Wingo
eaf21539d4 random_state_of_last_resort doesn't rely on HAVE_POSIX
* libguile/random.c (random_state_of_last_resort): Add the PID as a seed
  only if we have scm_getpid().
2013-02-24 12:46:48 +01:00
Mike Gran
99d1843e2a Update predefined character sets to Unicode 6.2
* libguile/srfi-14.i.c (cs_graphic_ranges, cs_printing_ranges, cs_symbol_ranges)
  (cs_designated_ranges): modified
2013-02-21 06:44:42 -08:00
Andy Wingo
f5ea559aa0 net_db.c doesn't import winsock2.h
* libguile/net_db.c: Don't include winsock2.h; gnulib handles this for
  us as necessary.
2013-02-20 22:57:02 +01:00