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

160 commits

Author SHA1 Message Date
Thien-Thi Nguyen
5838f795dc [slog] No longer use TIME_WITH_SYS_TIME
* configure.ac (struct tm.tm_gmtoff): Simplify conditional
preproc expression to not use ‘TIME_WITH_SYS_TIME’, and instead
#include <time.h> unconditionally.

* libguile/filesys.c: Simplify conditional preproc expression
to not use ‘TIME_WITH_SYS_TIME’, and instead #include <time.h>
unconditionally.
* libguile/posix.c: Likewise.
* libguile/gen-scmconfig.c: Likewise, for generation code.
2021-03-02 22:58:33 -05:00
Ludovic Courtès
93f68a5ac4 Remove set-but-unused variables from libguile.
* libguile/filesys.c (scm_readdir): Remove set-but-unused `namlen' variable.
* libguile/fports.c (fport_flush): Same for `written'.
* libguile/gc-segment.c (scm_i_initialize_heap_segment_data): Same
  for `bvec_ptr'.
* libguile/posix.c (scm_nice): Same for `nice_value'.
* libguile/scmsigs.c (take_signal): Same for `count'.
* libguile/srfi-4.c (uvec_to_list): Same for `elts'.
* libguile/stacks.c (scm_stack_ref): Same for `c_index'.
* libguile/threads.c (scm_std_select): Same for `count'.
* libguile/throw.c (scm_ithrow): Same for `answer'.
* libguile/unif.c (scm_i_read_array): Same for `got_rank'.
2012-05-23 14:55:38 +02:00
Neil Jerram
5be63eea82 Interix build warning fix
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I.. -I/src/g
uile-1.8.6 -I.. -g -O2 -Wall -Wmissing-prototypes -Werror -MT filesys.lo -MD -
MP -MF .deps/filesys.Tpo -c -o filesys.lo /src/guile-1.8.6/libguile/filesys.c
libtool: compile: gcc -DHAVE_CONFIG_H -I.. -I/src/guile-1.8.6 -I.. -g -O2 -Wall
-Wmissing-prototypes -Werror -MT filesys.lo -MD -MP -MF .deps/filesys.Tpo -c /s
rc/guile-1.8.6/libguile/filesys.c -DPIC -o .libs/filesys.o
/src/guile-1.8.6/libguile/filesys.c: In function `scm_readdir':
/src/guile-1.8.6/libguile/filesys.c:918: warning: implicit declaration of
function `readdir_r'

Report and fix provided by Jay Krell.

* libguile/filesys.c: On Interix, define _REENTRANT in order to pick
  up readdir_r prototype.
2010-03-26 00:48:08 +00:00
Ludovic Courtès
7a4e0d105e Include <config.h> in all C files; use #ifdef HAVE_CONFIG_H' rather than #if'. 2008-09-13 15:49:50 +02:00
Ludovic Courtès
e210266510 Use AC_USE_SYSTEM_EXTENSIONS' instead of the obsolete AC_AIX', etc. 2008-08-20 19:02:41 +02:00
Ludovic Courtès
d412e58c1f Fix `alloca' on FreeBSD 6. 2008-03-10 22:13:33 +00:00
Kevin Ryde
b98236412a (scm_init_filesys): Use scm_from_int rather than scm_from_long for
F_DUPFD, F_GETFD, F_SETFD, F_GETFL, F_SETFL, F_GETOWN, F_SETOWN, these
are all ints (per command arg to fcntl).  Likewise FD_CLOEXEC which is
an int arg to fcntl.
2007-01-15 21:52:52 +00:00
Kevin Ryde
43c6dfffaa (scm_init_filesys): Use scm_from_int rather than
scm_from_long for O_RDONLY, O_WRONLY, O_RDWR, O_CREAT, O_EXCL,
O_NOCTTY, O_TRUNC, O_APPEND, O_NONBLOCK, O_NDELAY, O_SYNC and
O_LARGEFILE.  These are all int not long.
2007-01-15 21:49:44 +00:00
Kevin Ryde
49acac79a1 Crib not on dirfd.m4 if we need/want dirfd everywhere in the future. 2006-09-23 01:43:59 +00:00
Kevin Ryde
0a331acc54 (dirfd): Test with #ifndef rather than HAVE_DIRFD, since
it's a macro on MacOS X.  Reported by Claes Wallin.
2006-07-24 01:38:24 +00:00
Kevin Ryde
a0ceceba5d (alloca): Update <alloca.h> etc blob, per current
autoconf recommendation.  Should fix Solaris 10 reported by Claes
Wallin.
2006-07-21 00:32:32 +00:00
Kevin Ryde
cd4387d987 Add malloc.h to get alloca() on mingw. Reported by "The Senator". 2006-05-27 22:49:09 +00:00
Kevin Ryde
9b638d67f2 (scm_stat2scm): Test #ifdef S_ISLNK directly, rather than
HAVE_S_ISLNK from configure (it was only a #ifdef test anyway).
2006-05-19 23:40:09 +00:00
Kevin Ryde
e6a7795376 (scm_open_fdes): Use open64.
(scm_init_filesys): Add O_LARGEFILE.
2006-05-09 00:26:01 +00:00
Kevin Ryde
c506a7fda5 (scm_stat2scm, scm_stat, scm_lstat): Use stat64.
(scm_readdir): Use readdir64.
(scm_copy_file): Use open64 and fstat64, to cope with >2Gb files.
2006-04-16 01:26:29 +00:00
Kevin Ryde
d34a52e744 (scm_readdir): Use fpathconf for the dirent size when
NAME_MAX is not available, which is so on Solaris 10.  Report and help
by Bill Schottstaedt.
2006-02-25 21:22:30 +00:00
Marius Vollmer
0ab652a386 Added 2006 to copyright years in every file, as per the new rules. 2006-02-12 13:42:52 +00:00
Marius Vollmer
661ae7ab6b Renamed the "frames" that are related to dynamic-wind to "dynamic
contexts.  Renamed all functions from scm_frame_ to scm_dynwind_.
Updated documentation.
2006-01-29 00:23:28 +00:00
Marius Vollmer
92205699d0 The FSF has a new address. 2005-05-23 19:57:22 +00:00
Marius Vollmer
9de87eea47 See ChangeLog from 2005-03-02. 2005-03-02 20:42:01 +00:00
Marius Vollmer
4057a3e05a Use new vector elements API or simple vector API, as appropriate.
Removed SCM_HAVE_ARRAYS ifdefery.  Replaced all uses of
SCM_HASHTABLE_BUCKETS with SCM_HASHTABLE_BUCKET.
2005-01-02 20:49:04 +00:00
Marius Vollmer
0345e278f4 * variable.c, threads.c, struct.c, stackchk.c, smob.c, root.c,
print.c, ports.c, mallocs.c, hooks.c, hashtab.c, fports.c,
guardians.c, filesys.c, coop-pthreads.c, continuations.c: Use
scm_uintprint to print unsigned integers, raw heap words, and
adresses, using a cast to scm_t_bits to turn pointers into
integers.
2004-10-22 15:13:12 +00:00
Marius Vollmer
d2e53ed6f8 *** empty log message *** 2004-09-22 17:41:37 +00:00
Kevin Ryde
464ee095ff (_POSIX_C_SOURCE): Use this only on hpux, it
causes too many problems elsewhere (glibc, freebsd, mingw).  Reported
by Andreas Vögele.
2004-09-08 22:14:59 +00:00
Stefan Jahn
edea856ce5 2004-09-03 Stefan Jahn <stefan@lkcc.org>
* configure.in (isinf): Let configure find the isinf() function
        on MinGW32 systems.

2004-09-03  Stefan Jahn  <stefan@lkcc.org>

        * threads.c (scm_threads_mark_stacks):  Fixed local variable
        definitions.

        * strings.c (scm_i_substring_copy, s_scm_string_append): Fixed
        local variable definitions.

        * stime.c (_POSIX_C_SOURCE):  Do not define this item on
        MinGW32 because it conflicts with its pthread headers.
        (s_scm_mktime): Consider the HAVE_STRUCT_TM_TM_ZONE define.
        (s_scm_strftime): Using scm_from_locale_string() instead of
        scm_makfrom0str().

        * posix.c (s_scm_putenv): Fixed typo in the !HAVE_UNSETENV
        part.

        * numbers.c (scm_init_numbers): Removed check_sanity() call
        inside GUILE_DEBUG.  The function has been removed somewhen...

        * filesys.c (_POSIX_C_SOURCE): Do not define this item on
        MinGW32 because it conflicts with its pthread headers.

2004-09-03  Stefan Jahn  <stefan@lkcc.org>

        * srfi-1.c, srfi-1.h: Renamed any 'lst1' into 'list1' because
        lst1 is a #define on Win32 systems.
2004-09-03 19:45:37 +00:00
Marius Vollmer
cc95e00ac6 * strings.h, strings.c: (scm_i_string_chars, scm_i_string_length,
scm_i_string_writable_chars, scm_i_string_stop_writing): New, to
replace SCM_I_STRING_CHARS and SCM_I_STRING_LENGTH.  Updated all
uses.
(scm_i_make_string, scm_c_make_string): New, to replace
scm_allocate_string.  Updated all uses.
(SCM_STRINGP, SCM_STRING_CHARS, SCM_STRING_UCHARS,
SCM_STRING_LENGTH): Deprecated.
(scm_allocate_string, scm_take_str, scm_take0str, scm_mem2string,
scm_str2string, scm_makfrom0str, scm_makfrom0str_opt):
Discouraged.  Replaced all uses with scm_from_locale_string or
similar, as appropriate.
(scm_c_string_length, scm_c_string_ref, scm_c_string_set_x,
scm_c_substring, scm_c_substring_shared, scm_c_substring_copy,
scm_substring_shared, scm_substring_copy): New.

* symbols.c, symbols.h (SCM_SYMBOLP, SCM_SYMBOL_FUNC,
SCM_SET_SYMBOL_FUNC, SCM_SYMBOL_PROPS, SCM_SET_SYMBOL_PROPS,
SCM_SYMBOL_HASH, SCM_SYMBOL_INTERNED_P, scm_mem2symbol,
scm_str2symbol, scm_mem2uninterned_symbol): Discouraged.
(SCM_SYMBOL_LENGTH, SCM_SYMBOL_CHARS, scm_c_symbol2str):
Deprecated.
(SCM_MAKE_SYMBOL_TAG, SCM_SET_SYMBOL_LENGTH, SCM_SET_SYMBOL_CHARS,
SCM_PROP_SLOTS, SCM_SET_PROP_SLOTS): Removed.
(scm_is_symbol, scm_from_locale_symbol, scm_from_locale_symboln):
New, to replace scm_str2symbol and scm_mem2symbol, respectively.
Updated all uses.
(scm_gensym): Generate only the number suffix in the buffer, just
string-append the prefix.
2004-08-19 17:19:44 +00:00
Marius Vollmer
1299a0f17b (STRING_SYSCALL, STRING2_SYSCALL): New helper macros.
Use them instead of SCM_SYSCALL when one or two strings need to be
converted into locale strings.
(my_rename): New, gathers platform dependent code for renaming.
(scm_rename): Use it.
(scm_readlink, scm_copy_file): Convert SCM strings to locale
strings instead of accessing their internals.
(scm_basename, scm_dirname): Use SCM_I_STRING_CHARS and
SCM_I_STRING_LENGTH instead of SCM_STRING_CHARS and
SCM_STRING_LENGTH.
2004-08-12 17:32:07 +00:00
Marius Vollmer
7f9994d904 * stime.c, socket.c, simpos.c, procs.c, posix.c, ports.c,
net_db.c, fports.c, filesys.c, eval.c, deprecation.c, dynl.c:
Replaced uses of SCM_STRING_CHARS with proper uses of
scm_to_locale_string.  Replaced SCM_STRINGP with scm_is_string.
Replaced scm_mem2string with scm_from_locale_string.

* simpos.c, posix.c (allocate_string_pointers, environ_list_to_c):
Removed, replaced all uses with scm_i_allocate_string_pointers.
2004-08-10 14:08:02 +00:00
Kevin Ryde
37eb673bc6 (scm_copy_file): Use fstat on the input fd rather than
stat on the filename, to be certain a file rename can't mean we get
info on one filesystem object but open another.  This fstat usage is
similar to Emacs copy-file.
2004-08-05 01:02:58 +00:00
Marius Vollmer
d9a67fc441 (scm_make_real, scm_num2dbl, scm_float2num, scm_double2num):
Discouraged by moving to discouraged.h and discouraged.c.
Replaced all uses with scm_from_double.
(scm_num2float, scm_num2double): Discouraged by moving prototype
to discouraged.h and rewriting in terms of scm_to_double.
Replaced all uses with scm_to_double.
2004-08-03 15:06:12 +00:00
Marius Vollmer
b9bd8526f0 * numbers.h, numbers.c, discouraged.h, discouraged.c (scm_short2num,
scm_ushort2num, scm_int2num, scm_uint2num, scm_long2num,
scm_ulong2num, scm_size2num, scm_ptrdiff2num, scm_num2short,
scm_num2ushort, scm_num2int, scm_num2uint, scm_num2long,
scm_num2ulong, scm_num2size, scm_num2ptrdiff, scm_long_long2num,
scm_ulong_long2num, scm_num2long_long, scm_num2ulong_long):
Discouraged by moving to discouraged.h and discouraged.c and
reimplementing in terms of scm_from_* and scm_to_*.  Changed all uses
to the new scm_from_* and scm_to_* functions.
2004-08-02 16:14:04 +00:00
Kevin Ryde
01046395ac (scm_copy_file): Avoid fd leak when destination file
cannot be opened.
2004-07-31 01:19:26 +00:00
Kevin Ryde
3572cd6b8f * error.c (scm_strerror): Use scm_i_misc_mutex around strerror since
it's not thread safe.
	(scm_syserror): Use scm_strerror rather than SCM_I_STRERROR, to take
	advantage of this.
	* fports.c (scm_open_file): Use scm_strerror likewise.
	* filesys.c (scm_stat, scm_lstat): Ditto.
2004-07-31 01:13:29 +00:00
Marius Vollmer
e11e83f3d9 * deprecated.h, deprecated.c, numbers.h (SCM_INUMP, SCM_NINUMP,
SCM_INUM): Deprecated by reenaming them to SCM_I_INUMP, SCM_I_NINUMP
and SCM_I_INUM, respectively and adding deprecated versions to
deprecated.h and deprecated.c.  Changed all uses to either use the
SCM_I_ variants or scm_is_*, scm_to_*, or scm_from_*, as appropriate.
2004-07-23 15:43:02 +00:00
Marius Vollmer
a55c2b6809 * validate.h, deprecated.h (SCM_VALIDATE_INUM, SCM_VALIDATE_INUM_COPY,
SCM_VALIDATE_BIGINT, SCM_VALIDATE_INUM_MIN,
SCM_VALIDATE_INUM_MIN_COPY,
SCM_VALIDATE_INUM_MIN_DEF_COPY,SCM_VALIDATE_INUM_DEF,
SCM_VALIDATE_INUM_DEF_COPY, SCM_VALIDATE_INUM_RANGE,
SCM_VALIDATE_INUM_RANGE_COPY): Deprecated because they make the
fixnum/bignum distinction visible.  Changed all uses to scm_to_size_t
or similar.
2004-07-10 14:35:36 +00:00
Marius Vollmer
93ccaef0c6 * numbers.h (SCM_MAKINUM, SCM_I_MAKINUM): Renamed SCM_MAKINUM to
SCM_I_MAKINUM and changed all uses.
2004-07-08 15:58:11 +00:00
Marius Vollmer
7888309be8 * deprecated.h, boolean.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOL,
SCM_NEGATE_BOOL, SCM_BOOLP): Deprecated by moving into "deprecated.h".
Replaced all uses with scm_is_false, scm_is_true, scm_from_bool, and
scm_is_bool, respectively.
2004-07-06 10:59:25 +00:00
Kevin Ryde
00fbf1e047 More of:
(_POSIX_C_SOURCE): Define to 199506L to get readdir_r (in
particular on HP-UX).  Reported by Andreas Vögele.
2004-05-01 21:30:37 +00:00
Kevin Ryde
6d484a0be7 (_POSIX_C_SOURCE): Define to 199506L to get readdir_r (in
particular on HP-UX).  Reported by Andreas Vögele.
2004-05-01 21:00:41 +00:00
Kevin Ryde
9be808d8c9 (scm_readdir): Use readdir_r when available, for thread safety. 2004-04-18 00:39:16 +00:00
Kevin Ryde
11e1db06ce (scm_getcwd, scm_readlink): Avoid memory leak on errors. 2004-03-25 22:26:17 +00:00
Stefan Jahn
2e945bccca 2003-05-29 Stefan Jahn <stefan@lkcc.org>
* configure.in: Removed -lm check and added a cached check for
        __libc_stack_end to get it building for mingw32 hosts.

2003-05-29  Stefan Jahn  <stefan@lkcc.org>

        * win32-dirent.c: Use malloc() instead of scm_malloc().

        * stime.c (s_scm_strftime): Add a type cast to avoid compiler
        warning.

        * posix.c (s_scm_putenv): Disable use of unsetenv() for the
        mingw32 build.

        * modules.c (s_scm_module_import_interface): Renamed local
        variable interface to _interface.  Seems like 'interface'
        is a special compiler directive for the mingw32 compiler.

        * mkstemp.c: Provide prototype to avoid compiler warning.

        * load.c (s_scm_search_path): Fixed absolute and relative
        path detections for native Windows platforms.

        * gc.h, threads.h: Export some more symbols using SCM_API
	(necessary to build on mingw32).

        * gc-freelist.c ("s_scm_map_free_list",
        "s_scm_gc_set_debug_check_freelist_x"): Fixed use of FUNC_NAME.

        * fports.c (fport_fill_input): Disable use of
        fport_wait_for_input() on Win32 platforms.

        * filesys.c (s_scm_basename): Fixed __MINGW32__ code.

        * Makefile.am: Modified some rules for cross compiling.

2003-05-29  Stefan Jahn  <stefan@lkcc.org>

        * raw-ltdl.c: Some more modifications for mingw32 platforms.

2003-05-29  Stefan Jahn  <stefan@lkcc.org>

        * Makefile.am (libguile_srfi_srfi_1_la_LDFLAGS,
        libguile_srfi_srfi_4_la_LDFLAGS,
        libguile_srfi_srfi_13_14__la_LDFLAGS): Added the -no-undefined
        option for the mingw32 build.

2003-05-29  Stefan Jahn  <stefan@lkcc.org>

        * standalone/Makefile.am: Setup to build on mingw32.
2003-05-29 14:39:13 +00:00
Marius Vollmer
73be1d9e8e Changed license terms to the plain LGPL thru-out. 2003-04-05 19:15:35 +00:00
Rob Browning
8307945424 * filesys.c: #include <config.h> if HAVE_CONFIG_H. 2003-03-25 23:54:53 +00:00
Marius Vollmer
3d7f708f21 * __scm.h (USE_THREADS, GUILE_ISELECT): Define when
SCM_DEBUG_DEPRECATED.  Removed their use thru-out Guile.
2002-11-03 22:09:20 +00:00
Han-Wen Nienhuys
34d19ef643 2002-07-20 Han-Wen <hanwen@cs.uu.nl>
* *.c: add space after commas everywhere.

* *.c: use SCM_VECTOR_SET everywhere, where a vector is written.
Document cases where SCM_WRITABLE_VELTS() is used.

* vectors.h (SCM_VELTS): prepare for write barrier, and let
SCM_VELTS() return a const pointer
(SCM_VECTOR_SET): add macro.

* autogen.sh (mscripts): find and check version number of
autoconf. Complain if 2.53 is not found.
2002-07-20 14:08:34 +00:00
Neil Jerram
bb2c02f237 Small docstring fixes. 2002-03-15 10:37:40 +00:00
Thien-Thi Nguyen
a6b844c224 Retire inclusion guard macro SCM_MAGIC_SNARFER. 2002-03-14 03:47:43 +00:00
Marius Vollmer
4c9419ac31 * gc.h, gc.c (scm_gc_sweep): Issue deprecation warning when
non-zero is returned from a port or smob free function.
(scm_malloc, scm_realloc, scm_strndup, scm_strdup,
scm_gc_register_collectable_memory,
scm_gc_unregister_collectable_memory, scm_gc_malloc,
scm_gc_realloc, scm_gc_free, scm_gc_strndup, scm_gc_strdup): New.

* backtrace.c, continuations.c, convert.i.c, coop-threads.c,
debug-malloc.c, dynl.c, environments.c, environments.h,
extensions.c, filesys.c, fports.c, gc.c, gc.h, gh_data.c, goops.c,
guardians.c, hooks.c, init.c, keywords.c, load.c, numbers.c,
ports.c, posix.c, procs.c, rdelim.c, regex-posix.c, root.c,
smob.c, stime.c, strings.c, struct.c, struct.h, symbols.c, unif.c,
vectors.c, weaks.c: Use scm_gc_malloc/scm_malloc and
scm_gc_free/free instead of scm_must_malloc and scm_must_free, as
appropriate.  Return zero from smob and port free functions.

* debug-malloc.c (scm_malloc_reregister): Handle "old == NULL".

* fports.c (scm_setvbuf): Reset read buffer to saved values when
it is pointing to the putback buffer.
2002-02-11 18:06:50 +00:00
Neil Jerram
c96d76b88d * First batch of libguile changes for Elisp support.
* Fixed a few typos.
* Minor rationalization of macros relating to source breakpoints.
2002-01-22 23:31:39 +00:00