]> code.delx.au - gnu-emacs/blobdiff - nt/inc/sys/socket.h
Merge from origin/emacs-25
[gnu-emacs] / nt / inc / sys / socket.h
index 95fee4c4659d37b8332988adbc626653f31f78db..d7ed92d61581d0a678ba687cc9f8a30e38fbea5f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 2001-201 Free Software Foundation, Inc.
+/* Copyright (C) 1995, 2001-2016 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -43,8 +43,9 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #undef FD_ZERO
 #endif
 
-/* avoid duplicate definition of timeval */
-#ifdef HAVE_TIMEVAL
+/* Avoid duplicate definition of timeval.  MinGW uses _TIMEVAL_DEFINED
+   in sys/time.h to avoid that.  */
+#if defined (HAVE_TIMEVAL) && defined (_MSC_VER)
 #define timeval ws_timeval
 #endif
 
@@ -62,7 +63,9 @@ typedef unsigned short uint16_t;
 #undef MUST_REDEF_SELECT
 #endif
 
-/* revert to our version of FD_SET */
+/* Revert to our version of FD_SET, but not when included from test
+   programs run by configure.  */
+#ifdef EMACS_CONFIG_H
 #undef FD_SET
 #undef FD_CLR
 #undef FD_ISSET
@@ -71,8 +74,9 @@ typedef unsigned short uint16_t;
 /* allow us to provide our own version of fd_set */
 #define fd_set ws_fd_set
 #include "w32.h"
+#endif /* EMACS_CONFIG_H */
 
-#ifdef HAVE_TIMEVAL
+#if defined (HAVE_TIMEVAL) && defined (_MSC_VER)
 #undef timeval
 #endif
 
@@ -119,7 +123,11 @@ int sys_sendto (int s, const char * buf, int len, int flags,
    an fcntl function, for setting sockets to non-blocking mode.  */
 int fcntl (int s, int cmd, int options);
 #define F_SETFL   4
+#define F_SETFD   2
 #define O_NONBLOCK  04000
+#define O_CLOEXEC O_NOINHERIT
+#define F_DUPFD_CLOEXEC 0x40000000
+#define FD_CLOEXEC 1
 
 /* we are providing a real h_errno variable */
 #undef h_errno