]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Update gnulib files.
authorSimon Josefsson <simon@josefsson.org>
Wed, 11 Feb 2009 12:24:29 +0000 (13:24 +0100)
committerSimon Josefsson <simon@josefsson.org>
Wed, 11 Feb 2009 12:24:29 +0000 (13:24 +0100)
gl/m4/close.m4
gl/m4/sockets.m4
gl/tests/sockets.h
gl/tests/test-sockets.c
lib/gl/m4/sockets.m4
lib/gl/sockets.h
lib/gl/tests/test-sockets.c

index fcc9fb1952ab50419841dbb9269b955872b5cab5..29d3abdd1365850bfc885d15688ee86dd3dea81e 100644 (file)
@@ -22,4 +22,6 @@ AC_DEFUN([gl_REPLACE_CLOSE],
   fi
   REPLACE_CLOSE=1
   gl_REPLACE_FCLOSE
+  LIB_CLOSE="-lws2_32"
+  AC_SUBST([LIB_CLOSE])
 ])
index d5a7dbfb4b944cfe8604b33c0bcc67eefd7a363c..db71bf14a0a674058bc85b12c2aa23c14286fb94 100644 (file)
@@ -1,4 +1,4 @@
-# sockets.m4 serial 4
+# sockets.m4 serial 5
 dnl Copyright (C) 2008, 2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -6,6 +6,8 @@ dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_SOCKETS],
 [
+  AC_REQUIRE([AC_C_INLINE])
+
   gl_PREREQ_SYS_H_WINSOCK2 dnl for HAVE_WINSOCK2_H
   LIBSOCKET=
   if test $HAVE_WINSOCK2_H = 1; then
index 33348db72d49a716b9cc5121d2e7335df326a9a6..bf180ac95d4350d543d107d041800bbef3d348ee 100644 (file)
@@ -1,6 +1,6 @@
 /* sockets.h - wrappers for Windows socket functions
 
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009 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
 int gl_sockets_startup (int version);
 int gl_sockets_cleanup (void);
 
+/* This function is useful it you create a socket using gnulib's
+   Winsock wrappers but needs to pass on the socket handle to some
+   other library that only accepts sockets. */
+#if WINDOWS_SOCKETS
+static inline SOCKET
+gl_fd_to_handle (int fd)
+{
+  return _get_osfhandle (fd);
+}
+#else
+#define gl_fd_to_handle(x) (x)
+#endif
+
 #endif
index 514409d95b6dbd09bce24c6bb06b70b4f4712e72..a37a1978c42a4ef0c50eda4abdc78d77082ff79c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008 Free Software Foundation
+ * Copyright (C) 2008, 2009 Free Software Foundation
  * Written by Simon Josefsson.
  *
  * This program is free software: you can redistribute it and/or modify
@@ -40,5 +40,7 @@ main (int argc, char *argv[])
       return 1;
     }
 
+  gl_fd_to_handle (0);
+
   return 0;
 }
index d5a7dbfb4b944cfe8604b33c0bcc67eefd7a363c..db71bf14a0a674058bc85b12c2aa23c14286fb94 100644 (file)
@@ -1,4 +1,4 @@
-# sockets.m4 serial 4
+# sockets.m4 serial 5
 dnl Copyright (C) 2008, 2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -6,6 +6,8 @@ dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_SOCKETS],
 [
+  AC_REQUIRE([AC_C_INLINE])
+
   gl_PREREQ_SYS_H_WINSOCK2 dnl for HAVE_WINSOCK2_H
   LIBSOCKET=
   if test $HAVE_WINSOCK2_H = 1; then
index f226640a17117f01c32cb732f35e00518de32845..6785824bd024f3a0667bc50ea12330bbff7d639c 100644 (file)
@@ -1,6 +1,6 @@
 /* sockets.h - wrappers for Windows socket functions
 
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
 int gl_sockets_startup (int version);
 int gl_sockets_cleanup (void);
 
+/* This function is useful it you create a socket using gnulib's
+   Winsock wrappers but needs to pass on the socket handle to some
+   other library that only accepts sockets. */
+#if WINDOWS_SOCKETS
+static inline SOCKET
+gl_fd_to_handle (int fd)
+{
+  return _get_osfhandle (fd);
+}
+#else
+#define gl_fd_to_handle(x) (x)
+#endif
+
 #endif
index 514409d95b6dbd09bce24c6bb06b70b4f4712e72..a37a1978c42a4ef0c50eda4abdc78d77082ff79c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008 Free Software Foundation
+ * Copyright (C) 2008, 2009 Free Software Foundation
  * Written by Simon Josefsson.
  *
  * This program is free software: you can redistribute it and/or modify
@@ -40,5 +40,7 @@ main (int argc, char *argv[])
       return 1;
     }
 
+  gl_fd_to_handle (0);
+
   return 0;
 }