guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.7-176-g6ab4d


From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.7-176-g6ab4de6
Date: Sat, 09 Mar 2013 21:50:17 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=6ab4de612510b7c8668f0b50388258392f25b157

The branch, stable-2.0 has been updated
       via  6ab4de612510b7c8668f0b50388258392f25b157 (commit)
       via  d3c88f18261b78f1ca9903f2f179b7f812288e1c (commit)
       via  7dfcaf2616f6a6a712aa8cbb454aca00419db08f (commit)
       via  3baf6e8b0577c32610cc6ba97af209185c16845a (commit)
       via  b0dbbacbe40fc8aa0b057101f84aed96ac4bea07 (commit)
       via  ce09e6bd0f2903566c14b4edf2659c19f2eb95b1 (commit)
       via  14b59d61028c94c8072f2f171fbc987102ad714d (commit)
       via  629987edfb1d03bcbdb6bf7f15d1ec0ff928e6f8 (commit)
       via  ba59471eeeeb6738f87e1c9c4050ce4698a7c9d8 (commit)
       via  eac7a5d03909291e62c671ead3d1c6a0ff84d4f0 (commit)
       via  44e30ef241e342406d69c7d9c480c630d6106612 (commit)
       via  cdd125e8d475a6d02606322fb4c54dc76bbc8072 (commit)
       via  4fd38267bca2987c6340c019a498ea6bacc6c5ec (commit)
      from  1adba49ab20ac283ca62963f115910f1cf7b63ad (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 6ab4de612510b7c8668f0b50388258392f25b157
Author: Andy Wingo <address@hidden>
Date:   Sat Mar 9 22:45:33 2013 +0100

    don't provide scm_std_select on mingw and similar platforms
    
    * libguile/iselect.h: If we do not have sys/select.h, don't provide
      scm_std_select, SELECT_TYPE, FD_SET, FD_ZERO, FD_ISSET, or FD_CLR.
      Guile should not be setting these macros in public API.  This is an
      incompatible change on mingw, but oh well.
    
    * libguile/threads.c: Rely on gnulib's select, and use that to implement
      scm_std_select.
    
    * libguile/deprecated.h:
    * libguile/deprecated.c: Only provide scm_internal_select if we have
      sys/select.h.

commit d3c88f18261b78f1ca9903f2f179b7f812288e1c
Author: Andy Wingo <address@hidden>
Date:   Sat Mar 9 22:42:17 2013 +0100

    simplify posix.c
    
    * libguile/posix.c: Reorder includes to fix mingw include-order
      problem.  Remove ttyname shims; gnulib is the place to fix that.
      Remove winsock2 include, as gnulib seems to handle that OK.  Rely on
      the new pipe-posix gnulib module.  Don't bother shimming getlogin, etc
      on mingw; gnulib is the place for shims.

commit 7dfcaf2616f6a6a712aa8cbb454aca00419db08f
Author: Andy Wingo <address@hidden>
Date:   Sat Mar 9 22:40:18 2013 +0100

    simplify readline.c
    
    * guile-readline/readline.c: Remove all mingw special-casing, relying
      instead on mingw / gnulib doing the right thing.

commit 3baf6e8b0577c32610cc6ba97af209185c16845a
Author: Andy Wingo <address@hidden>
Date:   Sat Mar 9 22:39:27 2013 +0100

    simplify stime back-compat shims for tzname
    
    * libguile/stime.c: Remove tzname declarations for ancient mingw and SGI
      RS6000.

commit b0dbbacbe40fc8aa0b057101f84aed96ac4bea07
Author: Andy Wingo <address@hidden>
Date:   Sat Mar 9 22:38:21 2013 +0100

    mingw include order for socket.c
    
    * libguile/socket.c: Reorder includes to fix include order on mingw.

commit ce09e6bd0f2903566c14b4edf2659c19f2eb95b1
Author: Andy Wingo <address@hidden>
Date:   Sat Mar 9 22:37:29 2013 +0100

    fix include-order problem in net_db.c for mingw
    
    * libguile/net_db.c: Reorder includes to avoid include-order problem on
      mingw.

commit 14b59d61028c94c8072f2f171fbc987102ad714d
Author: Andy Wingo <address@hidden>
Date:   Sat Mar 9 22:34:06 2013 +0100

    silence mingw32 warning in i18n.c
    
    * libguile/i18n.c (scm_make_locale): Silence a warning.

commit 629987edfb1d03bcbdb6bf7f15d1ec0ff928e6f8
Author: Andy Wingo <address@hidden>
Date:   Sat Mar 9 22:33:24 2013 +0100

    fports uses gnulib's select
    
    * libguile/fports.c: Reorder includes to put system includes first;
      fixes windows/winsock2 include error problem.  Rely on Gnulib's
      select module.
      (fport_input_waiting): Use select instead of scm_std_select.

commit ba59471eeeeb6738f87e1c9c4050ce4698a7c9d8
Author: Andy Wingo <address@hidden>
Date:   Sat Mar 9 22:30:26 2013 +0100

    simplify filesys.c via gnulib's select and fstat modules
    
    * libguile/filesys.c: Instead of using scm_std_select, just use select,
      relying on gnulib to provide it to us.  Likewise, rely on fstat.

commit eac7a5d03909291e62c671ead3d1c6a0ff84d4f0
Author: Andy Wingo <address@hidden>
Date:   Sat Mar 9 22:27:59 2013 +0100

    if we have threads on windows, we have pthreads; inform bdw-gc of that
    
    * libguile/bdw-gc.h: If we have threads enabled on mingw32, explicitly
      mark GC_WIN32_PTHREADS.  See
      
http://thread.gmane.org/gmane.comp.programming.garbage-collection.boehmgc/5564
      for more info.

commit 44e30ef241e342406d69c7d9c480c630d6106612
Author: Andy Wingo <address@hidden>
Date:   Sat Mar 9 22:26:16 2013 +0100

    remove init.c iselect include
    
    * libguile/init.c: Remove iselect include.

commit cdd125e8d475a6d02606322fb4c54dc76bbc8072
Author: Andy Wingo <address@hidden>
Date:   Sat Mar 9 22:25:35 2013 +0100

    portability simplification with scmsigs.c and alarm
    
    * configure.ac (alarm): Check for decl.
    * libguile/scmsigs.c: Reorder includes to put system includes first.
      Fixes include order on mingw.  Remove #define for alarm, as we will
      use HAVE_DECL_ALARM.  Remove #defines for sleep and usleep, as they
      are not used.
      (scm_alarm): Only define if HAVE_DECL_ALARM.

commit 4fd38267bca2987c6340c019a498ea6bacc6c5ec
Author: Andy Wingo <address@hidden>
Date:   Sat Mar 9 21:06:07 2013 +0100

    add gnulib fstat module explicitly
    
    * lib/Makefile.am:
    * m4/gnulib-cache.m4: Explicitly add fstat module.

-----------------------------------------------------------------------

Summary of changes:
 configure.ac              |    2 +
 guile-readline/readline.c |   31 +++-------------------
 lib/Makefile.am           |    2 +-
 libguile/bdw-gc.h         |    7 ++++-
 libguile/deprecated.c     |   19 ++++++++-----
 libguile/deprecated.h     |    8 +++--
 libguile/filesys.c        |   63 +++++++-------------------------------------
 libguile/fports.c         |   50 +++++++++++++++--------------------
 libguile/i18n.c           |    4 ++-
 libguile/init.c           |    3 +-
 libguile/iselect.h        |   33 +++++------------------
 libguile/net_db.c         |   20 +++++++-------
 libguile/posix.c          |   61 ++++++++++++-------------------------------
 libguile/scmsigs.c        |   34 ++++++++++--------------
 libguile/socket.c         |   36 +++++++++++++------------
 libguile/stime.c          |    9 +-----
 libguile/threads.c        |   22 +++++++++++----
 m4/gnulib-cache.m4        |    3 +-
 18 files changed, 151 insertions(+), 256 deletions(-)

diff --git a/configure.ac b/configure.ac
index d8919d3..31cb3a0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -919,6 +919,8 @@ AC_DEFUN([GUILE_FUNC_DECLARED], [
 GUILE_FUNC_DECLARED(sleep, unistd.h)
 GUILE_FUNC_DECLARED(usleep, unistd.h)
 
+AC_CHECK_DECLS([alarm])
+
 AC_CHECK_DECLS([strptime],,,
 [#define _GNU_SOURCE /* ask glibc to give strptime prototype */
 #include <time.h>])
diff --git a/guile-readline/readline.c b/guile-readline/readline.c
index 0e4ad29..68c8e60 100644
--- a/guile-readline/readline.c
+++ b/guile-readline/readline.c
@@ -1,6 +1,6 @@
 /* readline.c --- line editing support for Guile */
 
-/* Copyright (C) 1997,1999,2000,2001, 2002, 2003, 2006, 2007, 2008, 2009, 2010 
Free Software Foundation, Inc.
+/* Copyright (C) 1997,1999,2000,2001, 2002, 2003, 2006, 2007, 2008, 2009, 
2010, 2013 Free Software Foundation, Inc.
  * 
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -27,19 +27,13 @@
 
 #ifdef HAVE_RL_GETC_FUNCTION
 #include "libguile.h"
-#include "libguile/iselect.h"
 
 #include <stdio.h>
-#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#endif
 #include <readline/readline.h>
 #include <readline/history.h>
-#ifndef __MINGW32__
 #include <sys/time.h>
-#else
-#include <io.h>
-#endif
+#include <sys/select.h>
 #include <signal.h>
 
 #include "libguile/validate.h"
@@ -207,10 +201,8 @@ SCM_DEFINE (scm_readline, "%readline", 0, 4, 0,
 
   scm_dynwind_end ();
 
-#ifndef __MINGW32__
   fclose (rl_instream);
   fclose (rl_outstream);
-#endif
 
   --in_readline;
   return ans;
@@ -240,10 +232,8 @@ unwind_readline (void *unused)
   rl_free_line_state ();
   rl_cleanup_after_signal ();
   fputc ('\n', rl_outstream); /* We don't want next output on this line */
-#ifndef __MINGW32__
   fclose (rl_instream);
   fclose (rl_outstream);
-#endif
   --in_readline;
 }
 
@@ -319,10 +309,8 @@ scm_readline_init_ports (SCM inp, SCM outp)
 
   input_port = inp;
   output_port = outp;
-#ifndef __MINGW32__
   rl_instream = stream_from_fport (inp, "r", s_scm_readline);
   rl_outstream = stream_from_fport (outp, "w", s_scm_readline);
-#endif
 }
 
 
@@ -494,11 +482,9 @@ static int
 match_paren (int x, int k)
 {
   int tmp;
-#ifndef __MINGW32__
   int fno;
-  SELECT_TYPE readset;
+  fd_set readset;
   struct timeval timeout;
-#endif
 
   rl_insert (x, k);
   if (!SCM_READLINE_BOUNCE_PARENS)
@@ -509,14 +495,12 @@ match_paren (int x, int k)
       && rl_line_buffer[rl_point - 2] == '\\')
     return 0;
 
-#ifndef __MINGW32__
   tmp = 1000 * SCM_READLINE_BOUNCE_PARENS;
   timeout.tv_sec = tmp / 1000000;
   timeout.tv_usec = tmp % 1000000;
   FD_ZERO (&readset);
   fno = fileno (rl_instream);
   FD_SET (fno, &readset);
-#endif
 
   if (rl_point > 1)
     {
@@ -525,12 +509,7 @@ match_paren (int x, int k)
       if (rl_point > -1)
        {
          rl_redisplay ();
-#ifndef __MINGW32__
-         scm_std_select (fno + 1, &readset, NULL, NULL, &timeout);
-#else
-         WaitForSingleObject (GetStdHandle(STD_INPUT_HANDLE),
-                              SCM_READLINE_BOUNCE_PARENS); 
-#endif
+         select (fno + 1, &readset, NULL, NULL, &timeout);
        }
       rl_point = tmp;
     }
@@ -547,9 +526,7 @@ scm_init_readline ()
 #include "guile-readline/readline.x"
   scm_readline_completion_function_var
     = scm_c_define ("*readline-completion-function*", SCM_BOOL_F);
-#ifndef __MINGW32__
   rl_getc_function = current_input_getc;
-#endif
 #if defined (_RL_FUNCTION_TYPEDEF)
   rl_completion_entry_function = (rl_compentry_func_t*) completion_function;
 #else  
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 5659286..a0d857a 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -21,7 +21,7 @@
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --local-dir=gnulib-local 
--lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests 
--aux-dir=build-aux --lgpl=3 --no-conditional-dependencies --libtool 
--macro-prefix=gl --no-vc-files accept alignof alloca-opt announce-gen 
autobuild bind byteswap canonicalize-lgpl ceil clock-time close connect dirfd 
duplocale environ extensions flock floor fpieee frexp full-read full-write func 
gendocs getaddrinfo getpeername getsockname getsockopt git-version-gen 
gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf 
inet_ntop inet_pton isinf isnan ldexp lib-symbol-versions lib-symbol-visibility 
libunistring listen localcharset locale log1p maintainer-makefile malloc-gnu 
malloca nl_langinfo nproc open pipe-posix pipe2 putenv recv recvfrom regex 
rename select send sendto setenv setsockopt shutdown socket stat-time stdlib 
strftime striconveh string sys_stat times trunc verify vsnprintf warnings wchar
+# Reproduce by: gnulib-tool --import --dir=. --local-dir=gnulib-local 
--lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests 
--aux-dir=build-aux --lgpl=3 --no-conditional-dependencies --libtool 
--macro-prefix=gl --no-vc-files accept alignof alloca-opt announce-gen 
autobuild bind byteswap canonicalize-lgpl ceil clock-time close connect dirfd 
duplocale environ extensions flock floor fpieee frexp fstat full-read 
full-write func gendocs getaddrinfo getpeername getsockname getsockopt 
git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload havelib 
iconv_open-utf inet_ntop inet_pton isinf isnan ldexp lib-symbol-versions 
lib-symbol-visibility libunistring listen localcharset locale log1p 
maintainer-makefile malloc-gnu malloca nl_langinfo nproc open pipe-posix pipe2 
putenv recv recvfrom regex rename select send sendto setenv setsockopt shutdown 
socket stat-time stdlib strftime striconveh string sys_stat times trunc verify 
vsnprintf warnings wchar
 
 AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects
 
diff --git a/libguile/bdw-gc.h b/libguile/bdw-gc.h
index 2e1fce2..7aa757f 100644
--- a/libguile/bdw-gc.h
+++ b/libguile/bdw-gc.h
@@ -1,7 +1,7 @@
 #ifndef SCM_BDW_GC_H
 #define SCM_BDW_GC_H
 
-/* Copyright (C) 2006, 2008, 2009, 2011, 2012 Free Software Foundation, Inc.
+/* Copyright (C) 2006, 2008, 2009, 2011, 2012, 2013 Free Software Foundation, 
Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
@@ -37,6 +37,11 @@
    routines.  */
 # define GC_NO_THREAD_REDIRECTS 1
 
+#ifdef __MINGW32__
+/* Rely on pthreads-w32.  */
+#define GC_WIN32_PTHREADS
+#endif
+
 #endif
 
 #include <gc/gc.h>
diff --git a/libguile/deprecated.c b/libguile/deprecated.c
index b5e7cf3..e1dbfaf 100644
--- a/libguile/deprecated.c
+++ b/libguile/deprecated.c
@@ -24,6 +24,12 @@
 # include <config.h>
 #endif
 
+#include <math.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <arpa/inet.h>
+
 #define SCM_BUILDING_DEPRECATED_CODE
 
 #include "libguile/_scm.h"
@@ -60,11 +66,6 @@
 #include "libguile/feature.h"
 #include "libguile/uniform.h"
 
-#include <math.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <arpa/inet.h>
 
 #if (SCM_ENABLE_DEPRECATED == 1)
 
@@ -2356,16 +2357,18 @@ scm_thread_usleep (unsigned long t)
   return scm_std_usleep (t);
 }
 
+#ifdef HAVE_SYS_SELECT_H
 int scm_internal_select (int fds,
-                         SELECT_TYPE *rfds,
-                         SELECT_TYPE *wfds,
-                         SELECT_TYPE *efds,
+                         fd_set *rfds,
+                         fd_set *wfds,
+                         fd_set *efds,
                          struct timeval *timeout)
 {
   scm_c_issue_deprecation_warning
     ("`scm_internal_select' is deprecated. Use scm_std_select instead.");
   return scm_std_select (fds, rfds, wfds, efds, timeout);
 }
+#endif /* HAVE_SYS_SELECT_H */
 
 
 
diff --git a/libguile/deprecated.h b/libguile/deprecated.h
index 1812dd0..e17542b 100644
--- a/libguile/deprecated.h
+++ b/libguile/deprecated.h
@@ -742,11 +742,13 @@ SCM_DEPRECATED SCM scm_c_make_keyword (const char *s);
 
 SCM_DEPRECATED unsigned int scm_thread_sleep (unsigned int);
 SCM_DEPRECATED unsigned long scm_thread_usleep (unsigned long);
+#if SCM_HAVE_SYS_SELECT_H
 SCM_DEPRECATED int scm_internal_select (int fds,
-                                        SELECT_TYPE *rfds,
-                                        SELECT_TYPE *wfds,
-                                        SELECT_TYPE *efds,
+                                        fd_set *rfds,
+                                        fd_set *wfds,
+                                        fd_set *efds,
                                         struct timeval *timeout);
+#endif
 
 /* Deprecated because the cuserid call is deprecated.
  */
diff --git a/libguile/filesys.c b/libguile/filesys.c
index cd4be79..282ff31 100644
--- a/libguile/filesys.c
+++ b/libguile/filesys.c
@@ -45,7 +45,6 @@
 #include "libguile/feature.h"
 #include "libguile/fports.h"
 #include "libguile/private-gc.h"  /* for SCM_MAX */
-#include "libguile/iselect.h"
 #include "libguile/strings.h"
 #include "libguile/vectors.h"
 #include "libguile/dynwind.h"
@@ -81,9 +80,7 @@
 #include <libc.h>
 #endif
 
-#ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
-#endif
 
 #ifdef HAVE_STRING_H
 #include <string.h>
@@ -435,31 +432,6 @@ scm_stat2scm (struct stat_or_stat64 *stat_temp)
   return ans;
 }
 
-#ifdef __MINGW32__
-/*
- * Try getting the appropiate stat buffer for a given file descriptor
- * under Windows. It differentiates between file, pipe and socket 
- * descriptors.
- */
-static int fstat_Win32 (int fdes, struct stat *buf)
-{
-  int error, optlen = sizeof (int);
-
-  memset (buf, 0, sizeof (struct stat));
-
-  /* Is this a socket ? */
-  if (getsockopt (fdes, SOL_SOCKET, SO_ERROR, (void *) &error, &optlen) >= 0)
-    {
-      buf->st_mode = _S_IREAD | _S_IWRITE | _S_IEXEC;
-      buf->st_nlink = 1;
-      buf->st_atime = buf->st_ctime = buf->st_mtime = time (NULL);
-      return 0;
-    }
-  /* Maybe a regular file or pipe ? */
-  return fstat (fdes, buf);
-}
-#endif /* __MINGW32__ */
-
 static int
 is_file_name_separator (SCM c)
 {
@@ -544,11 +516,7 @@ SCM_DEFINE (scm_stat, "stat", 1, 1, 0,
 
   if (scm_is_integer (object))
     {
-#ifdef __MINGW32__
-      SCM_SYSCALL (rv = fstat_Win32 (scm_to_int (object), &stat_temp));
-#else
       SCM_SYSCALL (rv = fstat_or_fstat64 (scm_to_int (object), &stat_temp));
-#endif
     }
   else if (scm_is_string (object))
     {
@@ -561,11 +529,7 @@ SCM_DEFINE (scm_stat, "stat", 1, 1, 0,
       object = SCM_COERCE_OUTPORT (object);
       SCM_VALIDATE_OPFPORT (1, object);
       fdes = SCM_FPORT_FDES (object);
-#ifdef __MINGW32__
-      SCM_SYSCALL (rv = fstat_Win32 (fdes, &stat_temp));
-#else
       SCM_SYSCALL (rv = fstat_or_fstat64 (fdes, &stat_temp));
-#endif
     }
 
   if (rv == -1)
@@ -659,15 +623,13 @@ SCM_DEFINE (scm_chdir, "chdir", 1, 0, 0,
 
 
 
-#ifdef HAVE_SELECT
-
 /* check that element is a port or file descriptor.  if it's a port
    and its buffer is ready for use, add it to the ports_ready list.
    otherwise add its file descriptor to *set.  the type of list can be
    determined from pos: SCM_ARG1 for reads, SCM_ARG2 for writes,
    SCM_ARG3 for excepts.  */
 static int
-set_element (SELECT_TYPE *set, SCM *ports_ready, SCM element, int pos)
+set_element (fd_set *set, SCM *ports_ready, SCM element, int pos)
 {
   int fd;
 
@@ -713,7 +675,7 @@ set_element (SELECT_TYPE *set, SCM *ports_ready, SCM 
element, int pos)
    determined from pos: SCM_ARG1 for reads, SCM_ARG2 for writes,
    SCM_ARG3 for excepts.  */
 static int
-fill_select_type (SELECT_TYPE *set, SCM *ports_ready, SCM list_or_vec, int pos)
+fill_select_type (fd_set *set, SCM *ports_ready, SCM list_or_vec, int pos)
 {
   int max_fd = 0;
 
@@ -748,7 +710,7 @@ fill_select_type (SELECT_TYPE *set, SCM *ports_ready, SCM 
list_or_vec, int pos)
 /* if element (a file descriptor or port) appears in *set, cons it to
    list.  return list.  */
 static SCM
-get_element (SELECT_TYPE *set, SCM element, SCM list)
+get_element (fd_set *set, SCM element, SCM list)
 {
   int fd;
 
@@ -774,7 +736,7 @@ get_element (SELECT_TYPE *set, SCM element, SCM list)
    *set and appending them to ports_ready.  result is converted to a
    vector if list_or_vec is a vector.  */
 static SCM 
-retrieve_select_type (SELECT_TYPE *set, SCM ports_ready, SCM list_or_vec)
+retrieve_select_type (fd_set *set, SCM ports_ready, SCM list_or_vec)
 {
   SCM answer_list = ports_ready;
 
@@ -835,9 +797,9 @@ SCM_DEFINE (scm_select, "select", 3, 2, 0,
 {
   struct timeval timeout;
   struct timeval * time_ptr;
-  SELECT_TYPE read_set;
-  SELECT_TYPE write_set;
-  SELECT_TYPE except_set;
+  fd_set read_set;
+  fd_set write_set;
+  fd_set except_set;
   int read_count;
   int write_count;
   int except_count;
@@ -928,9 +890,9 @@ SCM_DEFINE (scm_select, "select", 3, 2, 0,
     }
 
   {
-    int rv = scm_std_select (max_fd + 1,
-                            &read_set, &write_set, &except_set,
-                            time_ptr);
+    int rv = select (max_fd + 1,
+                     &read_set, &write_set, &except_set,
+                     time_ptr);
     if (rv < 0)
       SCM_SYSERROR;
   }
@@ -939,7 +901,6 @@ SCM_DEFINE (scm_select, "select", 3, 2, 0,
                     retrieve_select_type (&except_set, SCM_EOL, excepts));
 }
 #undef FUNC_NAME
-#endif /* HAVE_SELECT */
 
 
 
@@ -1105,11 +1066,7 @@ SCM_DEFINE (scm_copy_file, "copy-file", 2, 0, 0,
   if (oldfd == -1)
     SCM_SYSERROR;
 
-#ifdef __MINGW32__
-  SCM_SYSCALL (rv = fstat_Win32 (oldfd, &oldstat));
-#else
   SCM_SYSCALL (rv = fstat_or_fstat64 (oldfd, &oldstat));
-#endif
   if (rv == -1)
     goto err_close_oldfd;
 
diff --git a/libguile/fports.c b/libguile/fports.c
index cdb9f99..e0b99b5 100644
--- a/libguile/fports.c
+++ b/libguile/fports.c
@@ -28,15 +28,6 @@
 
 #include <stdio.h>
 #include <fcntl.h>
-#include "libguile/_scm.h"
-#include "libguile/strings.h"
-#include "libguile/validate.h"
-#include "libguile/gc.h"
-#include "libguile/posix.h"
-#include "libguile/dynwind.h"
-#include "libguile/hashtab.h"
-
-#include "libguile/fports.h"
 
 #ifdef HAVE_STRING_H
 #include <string.h>
@@ -56,11 +47,20 @@
 #include <errno.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-
-#include "libguile/iselect.h"
+#include <sys/select.h>
 
 #include <full-write.h>
 
+#include "libguile/_scm.h"
+#include "libguile/strings.h"
+#include "libguile/validate.h"
+#include "libguile/gc.h"
+#include "libguile/posix.h"
+#include "libguile/dynwind.h"
+#include "libguile/hashtab.h"
+
+#include "libguile/fports.h"
+
 #if SIZEOF_OFF_T == SIZEOF_INT
 #define OFF_T_MAX  INT_MAX
 #define OFF_T_MIN  INT_MIN
@@ -558,37 +558,29 @@ fport_input_waiting (SCM port)
 
   return pollfd.revents & POLLIN ? 1 : 0;
 
-#elif defined(HAVE_SELECT)
+#else
   struct timeval timeout;
-  SELECT_TYPE read_set;
-  SELECT_TYPE write_set;
-  SELECT_TYPE except_set;
+  fd_set read_set;
+  fd_set write_set;
+  fd_set except_set;
 
   FD_ZERO (&read_set);
   FD_ZERO (&write_set);
   FD_ZERO (&except_set);
 
-  FD_SET (fdes, &read_set);
-  
+  if (fdes < FD_SETSIZE)
+    FD_SET (fdes, &read_set);
+  else
+    scm_out_of_range ("fport_input_waiting", scm_from_int (fdes));
+
   timeout.tv_sec = 0;
   timeout.tv_usec = 0;
 
-  if (select (SELECT_SET_SIZE,
+  if (select (fdes + 1,
              &read_set, &write_set, &except_set, &timeout)
       < 0)
     scm_syserror ("fport_input_waiting");
   return FD_ISSET (fdes, &read_set) ? 1 : 0;
-
-#elif HAVE_IOCTL && defined (FIONREAD)
-  int fdes = SCM_FSTREAM (port)->fdes;
-  int remir;
-  ioctl(fdes, FIONREAD, &remir);
-  return remir;
-
-#else    
-  scm_misc_error ("fport_input_waiting",
-                 "Not fully implemented on this platform",
-                 SCM_EOL);
 #endif
 }
 
diff --git a/libguile/i18n.c b/libguile/i18n.c
index 817c661..dc6d07d 100644
--- a/libguile/i18n.c
+++ b/libguile/i18n.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software 
Foundation, Inc.
+/* Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software 
Foundation, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
@@ -685,6 +685,8 @@ SCM_DEFINE (scm_make_locale, "make-locale", 2, 1, 0,
       }
   }
 
+  /* silence gcc's unused variable warning */
+  (void) c_base_locale;
 #endif
 
   return locale;
diff --git a/libguile/init.c b/libguile/init.c
index 17791e2..57e4902 100644
--- a/libguile/init.c
+++ b/libguile/init.c
@@ -1,5 +1,5 @@
 /* Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
- *   2004, 2006, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+ *   2004, 2006, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
@@ -75,7 +75,6 @@
 #include "libguile/gettext.h"
 #include "libguile/i18n.h"
 #include "libguile/instructions.h"
-#include "libguile/iselect.h"
 #include "libguile/ioext.h"
 #include "libguile/keywords.h"
 #include "libguile/list.h"
diff --git a/libguile/iselect.h b/libguile/iselect.h
index 760d959..092fb07 100644
--- a/libguile/iselect.h
+++ b/libguile/iselect.h
@@ -3,7 +3,7 @@
 #ifndef SCM_ISELECT_H
 #define SCM_ISELECT_H
 
-/* Copyright (C) 1997,1998,2000,2001, 2002, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1997,1998,2000,2001, 2002, 2006, 2013 Free Software 
Foundation, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
@@ -29,35 +29,18 @@
 #include <sys/types.h>
 
 #if SCM_HAVE_SYS_SELECT_H
-# include <sys/select.h>
-#endif
 
-#if SCM_HAVE_WINSOCK2_H
-# include <winsock2.h>
-#endif
+#include <sys/select.h>
 
-#ifdef FD_SET
+SCM_API int scm_std_select (int fds,
+                           fd_set *rfds,
+                           fd_set *wfds,
+                           fd_set *efds,
+                           struct timeval *timeout);
 
 #define SELECT_TYPE fd_set
-#define SELECT_SET_SIZE FD_SETSIZE
-
-#else /* no FD_SET */
-
-/* Define the macros to access a single-int bitmap of descriptors.  */
-#define SELECT_SET_SIZE 32
-#define SELECT_TYPE int
-#define FD_SET(n, p) (*(p) |= (1 << (n)))
-#define FD_CLR(n, p) (*(p) &= ~(1 << (n)))
-#define FD_ISSET(n, p) (*(p) & (1 << (n)))
-#define FD_ZERO(p) (*(p) = 0)
 
-#endif /* no FD_SET */
-
-SCM_API int scm_std_select (int fds,
-                           SELECT_TYPE *rfds,
-                           SELECT_TYPE *wfds,
-                           SELECT_TYPE *efds,
-                           struct timeval *timeout);
+#endif /* SCM_HAVE_SYS_SELECT_H */
 
 #endif  /* SCM_ISELECT_H */
 
diff --git a/libguile/net_db.c b/libguile/net_db.c
index f8007a4..95f0040 100644
--- a/libguile/net_db.c
+++ b/libguile/net_db.c
@@ -34,16 +34,6 @@
 #include <verify.h>
 #include <errno.h>
 
-#include "libguile/_scm.h"
-#include "libguile/feature.h"
-#include "libguile/strings.h"
-#include "libguile/vectors.h"
-#include "libguile/dynwind.h"
-
-#include "libguile/validate.h"
-#include "libguile/net_db.h"
-#include "libguile/socket.h"
-
 #ifdef HAVE_STRING_H
 #include <string.h>
 #endif
@@ -55,6 +45,16 @@
 #include <netinet/in.h>
 #include <arpa/inet.h>
 
+#include "libguile/_scm.h"
+#include "libguile/feature.h"
+#include "libguile/strings.h"
+#include "libguile/vectors.h"
+#include "libguile/dynwind.h"
+
+#include "libguile/validate.h"
+#include "libguile/net_db.h"
+#include "libguile/socket.h"
+
 
 #if defined (HAVE_H_ERRNO)
 /* Only wrap gethostbyname / gethostbyaddr if h_errno is available.  */
diff --git a/libguile/posix.c b/libguile/posix.c
index 39661a0..e7a3da7 100644
--- a/libguile/posix.c
+++ b/libguile/posix.c
@@ -32,23 +32,6 @@
 # include <sched.h>
 #endif
 
-#include "libguile/_scm.h"
-#include "libguile/dynwind.h"
-#include "libguile/fports.h"
-#include "libguile/scmsigs.h"
-#include "libguile/feature.h"
-#include "libguile/strings.h"
-#include "libguile/srfi-13.h"
-#include "libguile/srfi-14.h"
-#include "libguile/vectors.h"
-#include "libguile/values.h"
-
-#include "libguile/validate.h"
-#include "libguile/posix.h"
-#include "libguile/gettext.h"
-#include "libguile/threads.h"
-
-
 #ifdef HAVE_STRING_H
 #include <string.h>
 #endif
@@ -65,10 +48,6 @@
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#else
-#ifndef ttyname
-extern char *ttyname();
-#endif
 #endif
 
 #ifdef LIBC_H_WITH_UNISTD_H
@@ -85,15 +64,23 @@ extern char *ttyname();
 #ifdef HAVE_IO_H
 #include <io.h>
 #endif
-#ifdef HAVE_WINSOCK2_H
-#include <winsock2.h>
-#endif
 
-#ifdef __MINGW32__
-/* Some defines for Windows here. */
-# include <process.h>
-# define pipe(fd) _pipe (fd, 256, O_BINARY)
-#endif /* __MINGW32__ */
+#include "libguile/_scm.h"
+#include "libguile/dynwind.h"
+#include "libguile/fports.h"
+#include "libguile/scmsigs.h"
+#include "libguile/feature.h"
+#include "libguile/strings.h"
+#include "libguile/srfi-13.h"
+#include "libguile/srfi-14.h"
+#include "libguile/vectors.h"
+#include "libguile/values.h"
+
+#include "libguile/validate.h"
+#include "libguile/posix.h"
+#include "libguile/gettext.h"
+#include "libguile/threads.h"
+
 
 #if HAVE_SYS_WAIT_H
 # include <sys/wait.h>
@@ -1922,21 +1909,7 @@ SCM_DEFINE (scm_chroot, "chroot", 1, 0, 0,
 #endif /* HAVE_CHROOT */
 
 
-#ifdef __MINGW32__
-/* Wrapper function to supplying `getlogin()' under Windows.  */
-static char * getlogin (void)
-{
-  static char user[256];
-  static unsigned long len = 256;
-
-  if (!GetUserName (user, &len))
-    return NULL;
-  return user;
-}
-#endif /* __MINGW32__ */
-
-
-#if defined (HAVE_GETLOGIN) || defined (__MINGW32__)
+#if defined (HAVE_GETLOGIN)
 SCM_DEFINE (scm_getlogin, "getlogin", 0, 0, 0, 
             (void),
            "Return a string containing the name of the user logged in on\n"
diff --git a/libguile/scmsigs.c b/libguile/scmsigs.c
index 723d6a8..701beb5 100644
--- a/libguile/scmsigs.c
+++ b/libguile/scmsigs.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2002, 2004, 2006, 2007, 
2008, 2009, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2002, 2004, 2006, 2007, 
2008, 2009, 2011, 2013 Free Software Foundation, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
@@ -28,17 +28,6 @@
 #include <stdio.h>
 #include <errno.h>
 
-#include "libguile/_scm.h"
-
-#include "libguile/async.h"
-#include "libguile/eval.h"
-#include "libguile/root.h"
-#include "libguile/vectors.h"
-#include "libguile/threads.h"
-
-#include "libguile/validate.h"
-#include "libguile/scmsigs.h"
-
 #ifdef HAVE_PROCESS_H
 #include <process.h>    /* for mingw */
 #endif
@@ -51,16 +40,19 @@
 #include <sys/time.h>
 #endif
 
-#ifdef __MINGW32__
-#include <windows.h>
-#define alarm(sec) (0)
-/* This weird comma expression is because Sleep is void under Windows. */
-#define sleep(sec) (Sleep ((sec) * 1000), 0)
-#define usleep(usec) (Sleep ((usec) / 1000), 0)
-#endif
-
 #include <full-write.h>
 
+#include "libguile/_scm.h"
+
+#include "libguile/async.h"
+#include "libguile/eval.h"
+#include "libguile/root.h"
+#include "libguile/vectors.h"
+#include "libguile/threads.h"
+
+#include "libguile/validate.h"
+#include "libguile/scmsigs.h"
+
 
 
 
@@ -499,6 +491,7 @@ SCM_DEFINE (scm_restore_signals, "restore-signals", 0, 0, 0,
 }
 #undef FUNC_NAME
 
+#if defined HAVE_ALARM && HAVE_DECL_ALARM
 SCM_DEFINE (scm_alarm, "alarm", 1, 0, 0,
            (SCM i),
            "Set a timer to raise a @code{SIGALRM} signal after the specified\n"
@@ -514,6 +507,7 @@ SCM_DEFINE (scm_alarm, "alarm", 1, 0, 0,
   return scm_from_uint (alarm (scm_to_uint (i)));
 }
 #undef FUNC_NAME
+#endif /* HAVE_ALARM */
 
 #ifdef HAVE_SETITIMER
 SCM_DEFINE (scm_setitimer, "setitimer", 5, 0, 0,
diff --git a/libguile/socket.c b/libguile/socket.c
index ecb6754..bed069b 100644
--- a/libguile/socket.c
+++ b/libguile/socket.c
@@ -25,25 +25,8 @@
 #endif
 
 #include <errno.h>
-#include <gmp.h>
 #include <verify.h>
 
-#include "libguile/_scm.h"
-#include "libguile/arrays.h"
-#include "libguile/feature.h"
-#include "libguile/fports.h"
-#include "libguile/strings.h"
-#include "libguile/vectors.h"
-#include "libguile/dynwind.h"
-#include "libguile/srfi-13.h"
-
-#include "libguile/validate.h"
-#include "libguile/socket.h"
-
-#if SCM_ENABLE_DEPRECATED == 1
-# include "libguile/deprecation.h"
-#endif
-
 #ifdef HAVE_STDINT_H
 #include <stdint.h>
 #endif
@@ -62,6 +45,25 @@
 #include <netdb.h>
 #include <arpa/inet.h>
 
+#include <gmp.h>
+
+#include "libguile/_scm.h"
+#include "libguile/arrays.h"
+#include "libguile/feature.h"
+#include "libguile/fports.h"
+#include "libguile/strings.h"
+#include "libguile/vectors.h"
+#include "libguile/dynwind.h"
+#include "libguile/srfi-13.h"
+
+#include "libguile/validate.h"
+#include "libguile/socket.h"
+
+#if SCM_ENABLE_DEPRECATED == 1
+# include "libguile/deprecation.h"
+#endif
+
+
 
 #if defined (HAVE_UNIX_DOMAIN_SOCKETS) && !defined (SUN_LEN)
 #define SUN_LEN(ptr) ((size_t) (((struct sockaddr_un *) 0)->sun_path) \
diff --git a/libguile/stime.c b/libguile/stime.c
index 7fdbba9..90de697 100644
--- a/libguile/stime.c
+++ b/libguile/stime.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2003, 2004, 2005, 2006, 
2007, 2008, 2009, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2003, 2004, 2005, 2006, 
2007, 2008, 2009, 2011, 2013 Free Software Foundation, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public License
@@ -84,13 +84,6 @@
 # include <sys/timeb.h>
 #endif
 
-#ifndef tzname /* For SGI.  */
-extern char *tzname[]; /* RS6000 and others reject char **tzname.  */
-#endif
-#if defined (__MINGW32__)
-# define tzname _tzname
-#endif
-
 #if ! HAVE_DECL_STRPTIME
 extern char *strptime ();
 #endif
diff --git a/libguile/threads.c b/libguile/threads.c
index a3aee0f..c1b9c39 100644
--- a/libguile/threads.c
+++ b/libguile/threads.c
@@ -45,6 +45,8 @@
 # include <pthread_np.h>
 #endif
 
+#include <sys/select.h>
+
 #include <assert.h>
 #include <fcntl.h>
 #include <nproc.h>
@@ -1851,9 +1853,9 @@ SCM_DEFINE (scm_condition_variable_p, 
"condition-variable?", 1, 0, 0,
 struct select_args
 {
   int             nfds;
-  SELECT_TYPE    *read_fds;
-  SELECT_TYPE    *write_fds;
-  SELECT_TYPE    *except_fds;
+  fd_set         *read_fds;
+  fd_set         *write_fds;
+  fd_set         *except_fds;
   struct timeval *timeout;
 
   int             result;
@@ -1876,11 +1878,19 @@ do_std_select (void *args)
   return NULL;
 }
 
+#if !SCM_HAVE_SYS_SELECT_H
+static int scm_std_select (int nfds,
+                           fd_set *readfds,
+                           fd_set *writefds,
+                           fd_set *exceptfds,
+                           struct timeval *timeout);
+#endif
+
 int
 scm_std_select (int nfds,
-               SELECT_TYPE *readfds,
-               SELECT_TYPE *writefds,
-               SELECT_TYPE *exceptfds,
+               fd_set *readfds,
+               fd_set *writefds,
+               fd_set *exceptfds,
                struct timeval *timeout)
 {
   fd_set my_readfds;
diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4
index fe243f8..1543626 100644
--- a/m4/gnulib-cache.m4
+++ b/m4/gnulib-cache.m4
@@ -27,7 +27,7 @@
 
 
 # Specification in the form of a command-line invocation:
-#   gnulib-tool --import --dir=. --local-dir=gnulib-local --lib=libgnu 
--source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests 
--aux-dir=build-aux --lgpl=3 --no-conditional-dependencies --libtool 
--macro-prefix=gl --no-vc-files accept alignof alloca-opt announce-gen 
autobuild bind byteswap canonicalize-lgpl ceil clock-time close connect dirfd 
duplocale environ extensions flock floor fpieee frexp full-read full-write func 
gendocs getaddrinfo getpeername getsockname getsockopt git-version-gen 
gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf 
inet_ntop inet_pton isinf isnan ldexp lib-symbol-versions lib-symbol-visibility 
libunistring listen localcharset locale log1p maintainer-makefile malloc-gnu 
malloca nl_langinfo nproc open pipe-posix pipe2 putenv recv recvfrom regex 
rename select send sendto setenv setsockopt shutdown socket stat-time stdlib 
strftime striconveh string sys_stat times trunc verify vsnprintf warnings wchar
+#   gnulib-tool --import --dir=. --local-dir=gnulib-local --lib=libgnu 
--source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests 
--aux-dir=build-aux --lgpl=3 --no-conditional-dependencies --libtool 
--macro-prefix=gl --no-vc-files accept alignof alloca-opt announce-gen 
autobuild bind byteswap canonicalize-lgpl ceil clock-time close connect dirfd 
duplocale environ extensions flock floor fpieee frexp fstat full-read 
full-write func gendocs getaddrinfo getpeername getsockname getsockopt 
git-version-gen gitlog-to-changelog gnu-web-doc-update gnupload havelib 
iconv_open-utf inet_ntop inet_pton isinf isnan ldexp lib-symbol-versions 
lib-symbol-visibility libunistring listen localcharset locale log1p 
maintainer-makefile malloc-gnu malloca nl_langinfo nproc open pipe-posix pipe2 
putenv recv recvfrom regex rename select send sendto setenv setsockopt shutdown 
socket stat-time stdlib strftime striconveh string sys_stat times trunc verify 
vsnprintf warnings wchar
 
 # Specification in the form of a few gnulib-tool.m4 macro invocations:
 gl_LOCAL_DIR([gnulib-local])
@@ -52,6 +52,7 @@ gl_MODULES([
   floor
   fpieee
   frexp
+  fstat
   full-read
   full-write
   func


hooks/post-receive
-- 
GNU Guile



reply via email to

[Prev in Thread] Current Thread [Next in Thread]