changeset 2322:fb72d949bae3 libavformat

Check for winsock2.h instead of __MINGW32__
author ramiro
date Wed, 08 Aug 2007 19:18:10 +0000
parents 96bab3153939
children 43b803972ffd
files network.h os_support.c os_support.h
diffstat 3 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/network.h	Wed Aug 08 12:08:16 2007 +0000
+++ b/network.h	Wed Aug 08 19:18:10 2007 +0000
@@ -21,7 +21,7 @@
 #ifndef NETWORK_H
 #define NETWORK_H
 
-#ifdef __MINGW32__
+#ifdef HAVE_WINSOCK2_H
 #include <winsock2.h>
 #include <ws2tcpip.h>
 
--- a/os_support.c	Wed Aug 08 12:08:16 2007 +0000
+++ b/os_support.c	Wed Aug 08 19:18:10 2007 +0000
@@ -25,7 +25,7 @@
 #include <fcntl.h>
 
 #ifndef HAVE_SYS_POLL_H
-#if defined(__MINGW32__)
+#ifdef HAVE_WINSOCK2_H
 #include <winsock2.h>
 #else
 #include <sys/select.h>
@@ -70,7 +70,7 @@
 
 int ff_socket_nonblock(int socket, int enable)
 {
-#ifdef __MINGW32__
+#ifdef HAVE_WINSOCK2_H
    return ioctlsocket(socket, FIONBIO, &enable);
 #else
    if (enable)
@@ -92,7 +92,7 @@
     int n;
     int rc;
 
-#ifdef __MINGW32__
+#ifdef HAVE_WINSOCK2_H
     if (numfds >= FD_SETSIZE) {
         errno = EINVAL;
         return -1;
@@ -107,7 +107,7 @@
     for(i = 0; i < numfds; i++) {
         if (fds[i].fd < 0)
             continue;
-#ifndef __MINGW32__
+#ifndef HAVE_WINSOCK2_H
         if (fds[i].fd >= FD_SETSIZE) {
             errno = EINVAL;
             return -1;
--- a/os_support.h	Wed Aug 08 12:08:16 2007 +0000
+++ b/os_support.h	Wed Aug 08 19:18:10 2007 +0000
@@ -43,6 +43,9 @@
 #  define usleep(t)    Sleep((t) / 1000)
 #  include <fcntl.h>
 #  define lseek(f,p,w) _lseeki64((f), (p), (w))
+#endif
+
+#ifdef HAVE_WINSOCK2_H
 #  define HAVE_CLOSESOCKET 1
 #endif