vasnprintf: Optimize bit search operation.
[gnulib.git] / lib / w32sock.h
index 0622985..55280d6 100644 (file)
@@ -1,6 +1,6 @@
 /* w32sock.h --- internal auxilliary functions for Windows socket functions
 
-   Copyright (C) 2008 Free Software Foundation, Inc.
+   Copyright (C) 2008-2011 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
 /* Get O_RDWR and O_BINARY.  */
 #include <fcntl.h>
 
-/* Get _get_osfhandle() and _open_osfhandle().  */
+/* Get _open_osfhandle().  */
 #include <io.h>
 
+/* Get _get_osfhandle().  */
+#include "msvc-nothrow.h"
+
 #define FD_TO_SOCKET(fd)   ((SOCKET) _get_osfhandle ((fd)))
 #define SOCKET_TO_FD(fh)   (_open_osfhandle ((long) (fh), O_RDWR | O_BINARY))
 
@@ -32,7 +35,6 @@ static inline void
 set_winsock_errno (void)
 {
   int err = WSAGetLastError ();
-  WSASetLastError (0);
 
   /* Map some WSAE* errors to the runtime library's error codes.  */
   switch (err)