guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] GNU Guile branch, master, updated. release_1-9-14-137-g0


From: Ludovic Courtès
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-14-137-g0c247c3
Date: Sat, 29 Jan 2011 21:29: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=0c247c332b24e3afca3415bc98e393bb1d98069e

The branch, master has been updated
       via  0c247c332b24e3afca3415bc98e393bb1d98069e (commit)
       via  e91f21dc1093dc7be139f99d211edee01a64705f (commit)
       via  e9b7af013b34dcee7f67d8ecb8622b61904ad34e (commit)
      from  4c35b9f31cb08da1fa9ad69a95de4f5e9f70813b (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 0c247c332b24e3afca3415bc98e393bb1d98069e
Author: Ludovic Courtès <address@hidden>
Date:   Sat Jan 29 22:28:48 2011 +0100

    Add missing include for MinGW.
    
    * libguile/ports.h: Include <unistd.h>.

commit e91f21dc1093dc7be139f99d211edee01a64705f
Author: Ludovic Courtès <address@hidden>
Date:   Sat Jan 29 22:26:42 2011 +0100

    Make `inet-ntop' and `inet-pton' available even when !HAVE_IPV6.
    
    * libguile/socket.c (scm_inet_pton, scm_inet_ntop): Move out of `#ifdef
      HAVE_IPV6' and conditionalize the IPv6-specific bits.  Reported by
      Jan Nieuwenhuizen <address@hidden>.

commit e9b7af013b34dcee7f67d8ecb8622b61904ad34e
Author: Jan Nieuwenhuizen <address@hidden>
Date:   Sat Jan 29 19:51:37 2011 +0100

    When cross building, run GUILE_FOR_BUILD instead of just-built guile.
    
    * meta/guile.in: Run @GUILE_FOR_BUILD@ when cross-compiling.
    
    Signed-off-by: Ludovic Courtès <address@hidden>

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

Summary of changes:
 libguile/ports.h  |    1 +
 libguile/socket.c |   98 +++++++++++++++++++++++++++++++++--------------------
 meta/guile.in     |    6 +++-
 3 files changed, 67 insertions(+), 38 deletions(-)

diff --git a/libguile/ports.h b/libguile/ports.h
index 36289ef..7408b9b 100644
--- a/libguile/ports.h
+++ b/libguile/ports.h
@@ -26,6 +26,7 @@
 
 #include "libguile/__scm.h"
 
+#include <unistd.h>
 #include "libguile/print.h"
 #include "libguile/struct.h"
 #include "libguile/threads.h"
diff --git a/libguile/socket.c b/libguile/socket.c
index 923bd9f..aa52cac 100644
--- a/libguile/socket.c
+++ b/libguile/socket.c
@@ -45,6 +45,7 @@
 
 #ifdef __MINGW32__
 #include "win32-socket.h"
+#include <netdb.h>
 #endif
 
 #ifdef HAVE_STDINT_H
@@ -308,41 +309,9 @@ scm_to_ipv6 (scm_t_uint8 dst[16], SCM src)
     scm_wrong_type_arg_msg ("scm_to_ipv6", 0, src, "integer");
 }
 
-SCM_DEFINE (scm_inet_pton, "inet-pton", 2, 0, 0,
-            (SCM family, SCM address),
-           "Convert a string containing a printable network address to\n"
-           "an integer address.  Note that unlike the C version of this\n"
-           "function,\n"
-           "the result is an integer with normal host byte ordering.\n"
-           "@var{family} can be @code{AF_INET} or @code{AF_INET6}.  E.g.,\n\n"
-           "@lisp\n"
-           "(inet-pton AF_INET \"127.0.0.1\") @result{} 2130706433\n"
-           "(inet-pton AF_INET6 \"::1\") @result{} 1\n"
-           "@end lisp")
-#define FUNC_NAME s_scm_inet_pton
-{
-  int af;
-  char *src;
-  scm_t_uint32 dst[4];
-  int rv, eno;
+#endif  /* HAVE_IPV6 */
 
-  af = scm_to_int (family);
-  SCM_ASSERT_RANGE (1, family, af == AF_INET || af == AF_INET6);
-  src = scm_to_locale_string (address);
-  rv = inet_pton (af, src, dst);
-  eno = errno;
-  free (src);
-  errno = eno;
-  if (rv == -1)
-    SCM_SYSERROR;
-  else if (rv == 0)
-    SCM_MISC_ERROR ("Bad address", SCM_EOL);
-  if (af == AF_INET)
-    return scm_from_ulong (ntohl (*dst));
-  else
-    return scm_from_ipv6 ((scm_t_uint8 *) dst);
-}
-#undef FUNC_NAME
+
 
 SCM_DEFINE (scm_inet_ntop, "inet-ntop", 2, 0, 0,
             (SCM family, SCM address),
@@ -366,7 +335,12 @@ SCM_DEFINE (scm_inet_ntop, "inet-ntop", 2, 0, 0,
   const char *result;
 
   af = scm_to_int (family);
-  SCM_ASSERT_RANGE (1, family, af == AF_INET || af == AF_INET6);
+  SCM_ASSERT_RANGE (1, family,
+                   af == AF_INET
+#ifdef HAVE_IPV6
+                   || af == AF_INET6
+#endif
+                   );
   if (af == AF_INET)
     {
       scm_t_uint32 addr4;
@@ -374,13 +348,17 @@ SCM_DEFINE (scm_inet_ntop, "inet-ntop", 2, 0, 0,
       addr4 = htonl (SCM_NUM2ULONG (2, address));
       result = inet_ntop (af, &addr4, dst, sizeof (dst));
     }
-  else
+#ifdef HAVE_IPV6
+  else if (af == AF_INET6)
     {
       char addr6[16];
 
       scm_to_ipv6 ((scm_t_uint8 *) addr6, address);
       result = inet_ntop (af, &addr6, dst, sizeof (dst));
     }
+#endif
+  else
+    SCM_MISC_ERROR ("unsupported address family", family);
 
   if (result == NULL)
     SCM_SYSERROR;
@@ -389,8 +367,54 @@ SCM_DEFINE (scm_inet_ntop, "inet-ntop", 2, 0, 0,
 }
 #undef FUNC_NAME
 
-#endif  /* HAVE_IPV6 */
+SCM_DEFINE (scm_inet_pton, "inet-pton", 2, 0, 0,
+            (SCM family, SCM address),
+           "Convert a string containing a printable network address to\n"
+           "an integer address.  Note that unlike the C version of this\n"
+           "function,\n"
+           "the result is an integer with normal host byte ordering.\n"
+           "@var{family} can be @code{AF_INET} or @code{AF_INET6}.  E.g.,\n\n"
+           "@lisp\n"
+           "(inet-pton AF_INET \"127.0.0.1\") @result{} 2130706433\n"
+           "(inet-pton AF_INET6 \"::1\") @result{} 1\n"
+           "@end lisp")
+#define FUNC_NAME s_scm_inet_pton
+{
+  int af;
+  char *src;
+  scm_t_uint32 dst[4];
+  int rv, eno;
+
+  af = scm_to_int (family);
+  SCM_ASSERT_RANGE (1, family,
+                   af == AF_INET
+#ifdef HAVE_IPV6
+                   || af == AF_INET6
+#endif
+                   );
 
+  src = scm_to_locale_string (address);
+  rv = inet_pton (af, src, dst);
+  eno = errno;
+  free (src);
+  errno = eno;
+
+  if (rv == -1)
+    SCM_SYSERROR;
+  else if (rv == 0)
+    SCM_MISC_ERROR ("Bad address", SCM_EOL);
+  if (af == AF_INET)
+    return scm_from_ulong (ntohl (*dst));
+#ifdef HAVE_IPV6
+  else if (af == AF_INET6)
+    return scm_from_ipv6 ((scm_t_uint8 *) dst);
+#endif
+  else
+    SCM_MISC_ERROR ("unsupported address family", family);
+}
+#undef FUNC_NAME
+
+
 SCM_SYMBOL (sym_socket, "socket");
 
 #define SCM_SOCK_FD_TO_PORT(fd) scm_fdes_to_port (fd, "r+0", sym_socket)
diff --git a/meta/guile.in b/meta/guile.in
index d1ae0d4..5125827 100644
--- a/meta/guile.in
+++ b/meta/guile.in
@@ -45,7 +45,11 @@ XDG_CACHE_HOME=${top_builddir}/cache
 export XDG_CACHE_HOME
 
 # do it
-exec ${top_builddir}/meta/uninstalled-env $GUILE "$@"
+if test "@cross_compiling@" = "no"; then
+    exec ${top_builddir}/meta/uninstalled-env $GUILE "$@"
+else
+    exec @GUILE_FOR_BUILD@ "$@"
+fi
 
 # never reached
 exit 1


hooks/post-receive
-- 
GNU Guile



reply via email to

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