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

15943 commits

Author SHA1 Message Date
Eli Zaretskii
3dcd6341ac Untabify posix-w32.c 2016-07-16 20:00:56 +03:00
Eli Zaretskii
5079adea75 Improve process handling on MS-Windows
* libguile/posix-w32.c: Include gc.h and threads.h.
(proc_record): New structure tag.
<procs, proc_size>: New static variables.
(find_proc, proc_handle, record_proc, delete_proc): New utility
functions.
(start_child): Return value is now pid_t, as it is on Posix
platforms.  Record the new process and returns its PID, instead of
returning a handle.  Fix the recursive call.
(waitpid, kill, getpriority, setpriority, sched_getaffinity)
(sched_setaffinity): Look up the PID in the recorded subprocesses
before trying to open a process that is not our subprocess.  Make
sure any open handle is closed before returning, unless it's our
subprocess.
2016-07-16 19:58:25 +03:00
Andy Wingo
3f9ae30bd9 Fix mkstemp! with 1 argument
* libguile/filesys.c (scm_i_mkstemp): Add SCM_OPN to flags if mode
  argument not given.
2016-07-16 15:45:37 +02:00
Andy Wingo
0cf62c576d Allow mkstemp! to have optional "mode" argument
* m4/mkstemp.m4: Remove.
* lib/mkstemp.c: Remove.
* lib/mkostemp.c: New file.
* m4/mkostemp.m4: New file.
* lib/Makefile.am:
* m4/gnulib-cache.m4:
* m4/gnulib-comp.m4: Remove mkstemp module, replace with mkostemp.

* libguile/fports.h:
* libguile/fports.c (scm_i_mode_to_open_flags): Factor out helper to
  parse mode string to open flags.
  (scm_open_file_with_encoding): Use the new helper.
* libguile/filesys.c:
  (scm_i_mkstemp): Adapt to take optional second argument, being a mode
  string.  Use mkostemp.
  (scm_mkstemp): Backwards compatible shim that calls scm_i_mkstemp.

* doc/ref/posix.texi:
* NEWS: Update.

* module/system/base/compile.scm (call-with-output-file/atomic): Pass
  "wb" as mode, to cause O_BINARY to be added on MinGW.
2016-07-16 15:37:55 +02:00
Andy Wingo
c691c0e15a Fix bug compiling fixpoint combinator
* module/language/tree-il/peval.scm (<operand>): Rename "alias-value"
  field to "alias", which is now an operand and not an expression.
  This allows the operand to capture its environment; before, the
  alias was being visited in its use environment instead of its
  definition environment.
  (peval): Adapt to operand change.
* test-suite/tests/peval.test ("partial evaluation"): New test.
2016-07-16 12:05:21 +02:00
Ricardo Wurmus
2d6e224003 doc: Do not gender the programmer.
* doc/ref/api-foreign.texi: Replace "his" with "their".
* doc/ref/sxml.texi: Likewise.
2016-07-16 10:59:54 +02:00
Eli Zaretskii
cfb2d58c92 Update uname implementation in posix-w32
* libguile/posix-w32.c (uname): Update to modern processors (ia64 and
  x86_64) and OS versions (Vista to Windows 10).  Delete trailing
  whitespace.
2016-07-16 10:54:45 +02:00
Andy Wingo
21e40ea74c Fix unused static variables in net_db.c
* libguile/net_db.c (SCM_DEFINE_CONSTANT): New helper.  Use it to
  define constants and avoid the unneeded static variables that were
  used before, named "sym_" but actually holding variables.  Thanks to
  Eli Zaretskii for the report.
2016-07-16 10:51:38 +02:00
Andy Wingo
08d368012b Fix MinGW build error
* configure.ac: Fix for recent rename of win32-uname.c to posix-w32.c.
2016-07-16 10:35:21 +02:00
Andy Wingo
c1eb929258 Bump version number to 2.0.12
* GUILE-VERSION (GUILE_MICRO_VERSION): Bump to 2.0.12.
  (LIBGUILE_INTERFACE_CURRENT): Increment, to account for
  scm_pointer_to_procedure_with_errno et al.
  (LIBGUILE_INTERFACE_REVISION): Reset to 0.
  (LIBGUILE_INTERFACE_AGE): Still compatible with the past, so
  increment.
2016-07-14 16:59:02 +02:00
Andy Wingo
f935cdc912 Update NEWS
* NEWS: Update.
2016-07-14 16:37:20 +02:00
Andy Wingo
e8c93013e3 Add popen feature
* doc/ref/api-options.texi (Common Feature Symbols): Document the popen
  feature.
* doc/ref/posix.texi (Pipes): Depend on the popen feature, not fork.
* libguile/posix.c (scm_init_posix): Add popen feature if we can.
2016-07-14 16:33:32 +02:00
Andy Wingo
4e02ce55a6 Fix error when boot-9.go after "skip invalid .go files" commit
* module/ice-9/boot-9.scm (map, for-each): Move definition up before
  loading r4rs.go.  Before, when r4rs.go was being loaded, there was a
  window in which "catch" defined in Scheme used with-fluids before
  "map" was defined, but if "with-fluids" in eval.scm uses "map".  That
  would lead to the inability to catch errors (stack overflow) if
  `catch' was used in that window -- which it now is, due to the "skip
  invalid .go files" patch.
2016-07-14 16:20:59 +02:00
Andy Wingo
da757c6814 Refactor implementation of current-warning-port
* module/ice-9/boot-9.scm (current-warning-port):
* libguile/init.c (scm_init_standard_ports):
* libguile/ports.c (cur_warnport_fluid, scm_current_warning_port)
  (scm_set_current_warning_port, scm_init_ports): Define the warning
  port in the same way as the error/output/input ports, with a fluid
  that doesn't require calling out to Scheme.
2016-07-14 16:18:47 +02:00
Eli Zaretskii
1c98b78848 Add POSIX shims for MinGW
* libguile/posix-w32.h:
* libguile/posix-w32.c (kill, waitpid, getpriority, setpriority)
  (sched_getaffinity, sched_setaffinity): Add MinGW implementations.
  Also, provides macros that on Posix hosts are in sys/wait.h, like
  WIFEXITED and WTERMSIG.
  (start_child): Add implementation.
2016-07-12 16:06:22 +02:00
Andy Wingo
af3796b11c Don't recurse in drop-right
* module/srfi/srfi-1.scm (drop-right): Don't recurse, sadly, as we have
  a stack limit.
2016-07-12 15:53:40 +02:00
Andy Wingo
e1cb762c9a Keep trucking on weak table corruption
* libguile/hashtab.c (vacuum_weak_hash_table): Don't abort if we
  apparently remove more items than are in the table; instead print a
  warning.  "Fixes" #19180.
2016-07-12 09:30:10 +02:00
Andy Wingo
9c783616cc Reduce-right not limited by stack
* module/srfi/srfi-1.scm (reduce-right): Avoid blowing out the stack.
  Fixes #17485.
2016-07-12 09:05:51 +02:00
Andy Wingo
61b8794e04 Rename win32-uname.[ch] to posix-w32.[ch]
* libguile/posix-w32.c:
* libguile/posix-w32.h: Rename from win32-uname.c and win32-uname.h.
* libguile/posix.c:
* libguile/Makefile.am
  (EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES)
  (noinst_HEADERS): Adapt.
2016-07-11 23:18:27 +02:00
Andy Wingo
8e48a58fcb Ignore meta/build-env
* .gitignore: Ignore meta/build-env.
2016-07-11 23:18:27 +02:00
Andy Wingo
f6dd212045 Factor start_child out of open_process
* libguile/posix.c (start_child): Factor out from open_process.  Based
  on initial work by Eli Zaretskii.
2016-07-11 22:54:33 +02:00
Andy Wingo
0fb3e82cee More specific status:exit-val et al compilation guards
* libguile/posix.c (scm_status_exit_val, scm_status_term_sig)
  (scm_status_stop_sig): Guard on WIFEXITED et al macros instead of on
  MinGW.
2016-07-11 22:54:33 +02:00
Andy Wingo
2ef67d08ef getaffinity, setaffinity docstring cleanup
* libguile/posix.c (scm_getaffinity, scm_setaffinity): Clean up
  docstrings.  Obviously if you have the function, you don't need to be
  told that you have it in the docstring.
2016-07-11 22:17:59 +02:00
Andy Wingo
2247a56d5d Provide `kill' only if supported by the host
* libguile/posix.c (scm_kill): Only provide if the host has `kill'.  An
  incompatible change on MinGW, where this function would work only if
  the PID was the current PID, but that will be fixed by the next
  process.
2016-07-11 22:17:09 +02:00
Andy Wingo
509c4205ba More robust setuid, setgid, etc detection
* configure.ac: Check for getuid, getgid, setuid, and setgid.
* libguile/posix.c (scm_getuid, scm_getgid, scm_setuid, scm_setgid):
  Only provide Scheme functions if the OS provides these facilities.
  (scm_geteuid, scm_getegid, scm_seteuid, scm_setegid): Provide if the
  host has getuid, getgid, etc, instead of being in a MinGW guard.
2016-07-11 22:14:38 +02:00
Andy Wingo
e2c1659d95 Locale is default port encoding
* libguile/ports.c (scm_init_ports): Use the locale as the default
  charset.  This allows GUILE_INSTALL_LOCALE=1 to work properly,
  harmonizing the default port encoding with the installed locale.
2016-07-11 18:21:52 +02:00
Ludovic Courtès
a14e873cce Fix invalid use of 'PTR2SCM'.
Fixes a typo introduced in 04359b42b9.

* libguile/load.c (try_load_thunk_from_file): Use 'SCM2PTR', not
'PTR2SCM'.
2016-07-11 11:04:34 +02:00
Ludovic Courtès
2c5ab455c2 Add missing 'const' qualifier.
* libguile/stime.c (tzvar): Add 'const'.
2016-07-11 11:01:51 +02:00
Ludovic Courtès
2bdd40a696 Unconditionally include <time.h> from Gnulib.
* libguile/stime.c: Unconditionally include <time.h>.
2016-07-11 11:01:51 +02:00
Ludovic Courtès
92b8087d7d build: Remove unneeded check for 'unsetenv'.
* configure.ac: Remove check for 'unsetenv', which is unneeded since we
use Gnulib's 'unsetenv'.
2016-07-11 11:01:51 +02:00
Andy Wingo
5b7b5749e1 Add meta/build-env
* meta/build-env.in: New file which sets up an environment that does not
  inherit GUILE_LOAD_PATH / GUILE_LOAD_COMPILED_PATH (unless
  cross-compiling).
* doc/ref/Makefile.am (autoconf-macros.texi):
* libguile/Makefile.am (snarf2checkedtexi):
* module/Makefile.am (ice-9/psyntax-pp.go):
* test-suite/standalone/Makefile.am (GUILE_INSTALL_LOCALE):
* am/guilec (.scm.go): Use build-env.
* configure.ac: Create build-env.
2016-07-10 13:21:38 +02:00
Andy Wingo
a39ac7db60 Avoid Gnulib unistr/* modules
(unistr/base, unistr/u8-mbtouc, unistr/u8-mbtouc-unsafe)
(unistr/u8-mbtoucr, unistr/u8-prev unistr/u8-uctomb, unitypes): --avoid
these modules.
2016-07-10 12:57:55 +02:00
Andy Wingo
a92acb5fa4 Update Gnulib to 68b6ade.
Also add --conditional-dependencies to the flags.  See:
https://lists.gnu.org/archive/html/guile-devel/2016-07/msg00012.html
2016-07-07 12:39:14 +02:00
Andy Wingo
04359b42b9 Skip incompatible .go files
* libguile/load.c (load_thunk_from_path, try_load_thunk_from_file):
  New functions.
  (search_path): Simplify.
  (scm_primitive_load_path, scm_init_eval_in_scheme): Use the new
  functions to load compiled files.
* module/ice-9/boot-9.scm (load-in-vicinity): Skip invalid .go files.

Inspired by a patch from Jan Nieuwenhuizen <janneke@gnu.org>.
2016-06-29 18:10:24 +02:00
Andy Wingo
abc003fb45 Update NEWS
* NEWS: Update.
2016-06-29 13:10:50 +02:00
Andy Wingo
2b421e02e1 Update Gnulib to 6835fc458f30b94f15d69c35a79cbc2dfabe2d06. 2016-06-29 11:32:05 +02:00
Andy Wingo
bfca4367b0 Update git-version-gen.diff
* gnulib-local/build-aux/git-version-gen.diff: Update to apply to latest
  gnulib.
2016-06-29 11:11:53 +02:00
Andy Wingo
543ec017ef Temporarily use git-version-gen from gnulib 2016-06-29 11:03:50 +02:00
Andy Wingo
e9538ef69b Update NEWS 2016-06-29 10:49:14 +02:00
Ludovic Courtès
8f644ef87a doc: smobs: Fix typos.
* doc/ref/api-smobs.texi (Smobs): Fix typos.
2016-06-28 22:51:57 +02:00
Ludovic Courtès
a5094286c9 Update NEWS. 2016-06-28 22:47:10 +02:00
David Pirotte
a0e96d978d Do not track some test-suite files
* .gitignore:  Adding test-smob-mark-race to the list of the test-suite
  files we do not track.
2016-06-27 09:35:35 +02:00
Andy Wingo
811024669a Add documentation pointer from getopt-long to SRFI-37.
* doc/ref/mod-getopt-long.texi (getopt-long): Point to SRFI-37.
2016-06-26 22:38:00 +02:00
Andy Wingo
da0f1eadaa Favor "escape continuation" over "one-shot continuation" in manual
* doc/ref/api-control.texi (Prompt Primitives): Remove mention of
  one-shot continuations, as it's possible to invoke them multiple times
  if the continuation is re-entered through other means.
2016-06-26 22:38:00 +02:00
Andy Wingo
96f55b7f36 Check for strtod_l before using it.
Based on a patch by Andy Stormont <astormont@racktopsystems.com>.

* configure.ac: Check for strtod_l.
* libguile/i18n.c (scm_locale_string_to_integer): Fix style.
  (scm_locale_string_to_inexact): Check for strtod_l.
2016-06-26 22:37:47 +02:00
Andy Wingo
45b80a1fa8 Constant-folding eq? and eqv? uses deduplication
* test-suite/tests/peval.test ("partial evaluation"): Add tests.
* module/language/tree-il/peval.scm (peval): Constant-fold eq? and eqv?
  using equal?, anticipating deduplication.
2016-06-26 22:37:33 +02:00
Andy Wingo
ef2943e806 Prevent (@ (ice-9 boot-9) x)
* module/ice-9/boot-9.scm: Prevent re-loading, perhaps via (@ (ice-9
  boot-9) foo).  (ice-9 boot-9) isn't a module.  Fixes #21801.
2016-06-26 22:31:21 +02:00
Andy Wingo
a0d76d9c9e Fix texinfo->html for @acronym, @itemize
* module/texinfo/html.scm (itemize, acronym, tag-replacements, rules):
  Fix HTML serialization of @itemize and @acronym.  Fixes #21772.
* test-suite/tests/texinfo.html.test: New file.
* test-suite/Makefile.am: Add new file.
2016-06-26 22:30:57 +02:00
Daniel Llorens
937bd9509c Avoid stifling readline history when looking up options
With this patch, history is never stifled unless (readline-set!) is used.

* src/guile-readline/readline.c (scm_readline_options)
2016-06-26 22:30:05 +02:00
Andy Wingo
8707958e6c Fix typo about `keywords' read option
* doc/ref/api-data.texi (Keyword Read Syntax): Fix typo.  Thanks to
  Glenn Michaels for the report and fix.
2016-06-26 22:27:54 +02:00