guile-devel
[Top][All Lists]
Advanced

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

Re: mingw patch


From: Jan Nieuwenhuizen
Subject: Re: mingw patch
Date: Mon, 02 May 2005 20:51:20 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

Kevin Ryde writes:

> That'd be better as a HAVE_SOCKLEN_T.
> And this would definitely be better as a HAVE_STRUCT_IP_MREQ or
> whatever.

Ok, better version below.

Jan.

Index: ChangeLog
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/ChangeLog,v
retrieving revision 1.463
diff -p -u -r1.463 ChangeLog
--- ChangeLog   13 Mar 2005 00:37:33 -0000      1.463
+++ ChangeLog   2 May 2005 13:23:36 -0000
@@ -1,3 +1,7 @@
+2005-05-02  Jan Nieuwenhuizen  <address@hidden>
+
+       * configure.in: Add tests for socklen_t and ip_mreq.
+
 2005-03-13  Kevin Ryde  <address@hidden>
 
        * configure.in, GUILE-VERSION (LIBGUILE_SRFI_SRFI_60): New defines.
Index: configure.in
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/configure.in,v
retrieving revision 1.265
diff -p -u -r1.265 configure.in
--- configure.in        13 Mar 2005 00:36:50 -0000      1.265
+++ configure.in        2 May 2005 13:23:37 -0000
@@ -520,6 +520,9 @@ AC_SUBST([SCM_I_GSC_T_UINTMAX])
 AC_SUBST([SCM_I_GSC_NEEDS_STDINT_H])
 AC_SUBST([SCM_I_GSC_NEEDS_INTTYPES_H])
 
+AC_CHECK_TYPE(socklen_t, int)
+AC_CHECK_TYPE(struct ip_mreq)
+
 AC_HEADER_STDC
 AC_HEADER_DIRENT
 AC_HEADER_TIME
Index: libguile/ChangeLog
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/libguile/ChangeLog,v
retrieving revision 1.2268
diff -p -u -r1.2268 ChangeLog
--- libguile/ChangeLog  30 Apr 2005 20:54:35 -0000      1.2268
+++ libguile/ChangeLog  2 May 2005 13:23:38 -0000
@@ -1,3 +1,20 @@
+2005-05-02  Jan Nieuwenhuizen  <address@hidden>
+
+       * hashtab.h: Bugfix: use SCM_API (WAS: extern).
+
+       * socket.c: Remove obsolete comment about socklen_t.
+       (s_scm_setsockopt)[!HAVE_IP_MREQ]: Do not use ip_mreq code.
+
+       * numbers.h (isnan)[__MINGW32__]: Remove.
+
+       * Makefile.am (gen_scmconfig_SOURCES): Bugfix: Add
+       DEFAULT_INCLUDES when cross compiling.
+
+       * threads.c (ETIMEDOUT, pipe)[__MINGW32__]: Add defines.
+
+       * stime.c (s_scm_strftime)[!HAVE_TM_ZONE]: Use scm_vector_elements
+       instead of SCM_VELTS.
+
 2005-04-30  Han-Wen Nienhuys  <address@hidden>
 
        * list.h: remove scm_list()
Index: libguile/Makefile.am
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/libguile/Makefile.am,v
retrieving revision 1.202
diff -p -u -r1.202 Makefile.am
--- libguile/Makefile.am        8 Mar 2005 00:53:21 -0000       1.202
+++ libguile/Makefile.am        2 May 2005 13:23:38 -0000
@@ -42,7 +42,7 @@ gen_scmconfig_SOURCES = gen-scmconfig.c
 ## For some reason, OBJEXT does not include the dot
 gen-scmconfig.$(OBJEXT): gen-scmconfig.c
        if [ "$(cross_compiling)" = "yes" ]; then \
-               $(CC_FOR_BUILD) $(DEFS) $(INCLUDES) -c -o $@ $<; \
+               $(CC_FOR_BUILD) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) -c -o 
$@ $<; \
        else \
                $(COMPILE) -c -o $@ $<; \
        fi
Index: libguile/hashtab.h
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/libguile/hashtab.h,v
retrieving revision 1.30
diff -p -u -r1.30 hashtab.h
--- libguile/hashtab.h  4 Apr 2005 14:53:27 -0000       1.30
+++ libguile/hashtab.h  2 May 2005 13:23:38 -0000
@@ -31,7 +31,7 @@
 #define SCM_HASHTABLEF_WEAK_CAR SCM_WVECTF_WEAK_KEY
 #define SCM_HASHTABLEF_WEAK_CDR SCM_WVECTF_WEAK_VALUE
 
-extern scm_t_bits scm_tc16_hashtable;
+SCM_API scm_t_bits scm_tc16_hashtable;
 
 #define SCM_HASHTABLE_P(x)        SCM_SMOB_PREDICATE (scm_tc16_hashtable, x)
 #define SCM_VALIDATE_HASHTABLE(pos, arg) \
Index: libguile/numbers.h
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/libguile/numbers.h,v
retrieving revision 1.99
diff -p -u -r1.99 numbers.h
--- libguile/numbers.h  14 Apr 2005 00:35:50 -0000      1.99
+++ libguile/numbers.h  2 May 2005 13:23:38 -0000
@@ -92,7 +92,6 @@
 #  include <float.h>
 #  ifdef __MINGW32__
 #   define copysign _copysign
-#   define isnan _isnan
 #   define finite _finite
 #  endif /* __MINGW32__ */
 # endif /* ndef GO32 */
Index: libguile/socket.c
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/libguile/socket.c,v
retrieving revision 1.112
diff -p -u -r1.112 socket.c
--- libguile/socket.c   27 Feb 2005 23:50:30 -0000      1.112
+++ libguile/socket.c   2 May 2005 13:23:39 -0000
@@ -67,10 +67,6 @@
                      + strlen ((ptr)->sun_path))
 #endif
 
-/* we are not currently using socklen_t.  it's not defined on all systems,
-   so would need to be checked by configure.  in the meantime, plain
-   int is the best alternative.  */
-
 
 
 SCM_DEFINE (scm_htons, "htons", 1, 0, 0, 
@@ -550,7 +546,10 @@ SCM_DEFINE (scm_setsockopt, "setsockopt"
 #ifdef HAVE_STRUCT_LINGER
   struct linger opt_linger;
 #endif
+
+#if HAVE_STRUCT_IP_MREQ
   struct ip_mreq opt_mreq;
+#endif
 
   const void *optval = NULL;
   socklen_t optlen = 0;
@@ -602,6 +601,7 @@ SCM_DEFINE (scm_setsockopt, "setsockopt"
          }
     }
 
+#if HAVE_STRUCT_IP_MREQ
   if (ilevel == IPPROTO_IP &&
       (ioptname == IP_ADD_MEMBERSHIP || ioptname == IP_DROP_MEMBERSHIP))
     {
@@ -612,6 +612,7 @@ SCM_DEFINE (scm_setsockopt, "setsockopt"
       optlen = sizeof (opt_mreq);
       optval = &opt_mreq;
     }
+#endif
 
   if (optval == NULL)
     {
Index: libguile/stime.c
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/libguile/stime.c,v
retrieving revision 1.102
diff -p -u -r1.102 stime.c
--- libguile/stime.c    7 Mar 2005 21:42:02 -0000       1.102
+++ libguile/stime.c    2 May 2005 13:23:39 -0000
@@ -653,7 +653,10 @@ SCM_DEFINE (scm_strftime, "strftime", 2,
        environment.  interrupts and thread switching must be deferred
        until TZ is restored.  */
     char **oldenv = NULL;
-    SCM *velts = (SCM *) SCM_VELTS (stime);
+    scm_t_array_handle handle;
+    size_t len;
+    ssize_t inc;
+    SCM *velts = scm_vector_elements (stime, &handle, &len, &inc);
     int have_zone = 0;
 
     if (scm_is_true (velts[10]) && *SCM_STRING_CHARS (velts[10]) != 0)
Index: libguile/threads.c
===================================================================
RCS file: /cvsroot/guile/guile/guile-core/libguile/threads.c,v
retrieving revision 1.78
diff -p -u -r1.78 threads.c
--- libguile/threads.c  24 Mar 2005 10:21:22 -0000      1.78
+++ libguile/threads.c  2 May 2005 13:23:39 -0000
@@ -43,6 +43,15 @@
 #include "libguile/continuations.h"
 #include "libguile/init.h"
 
+#ifdef __MINGW32__
+#ifndef ETIMEDOUT
+# define ETIMEDOUT       WSAETIMEDOUT
+#endif
+# include <fcntl.h>
+# include <process.h>
+# define pipe(fd) _pipe (fd, 256, O_BINARY)
+#endif /* __MINGW32__ */
+
 /*** Queues */
 
 /* Make an empty queue data structure.


-- 
Jan Nieuwenhuizen <address@hidden> | GNU LilyPond - The music typesetter
http://www.xs4all.nl/~jantien       | http://www.lilypond.org




reply via email to

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