[FFmpeg-cvslog] r9988 - in trunk: configure libavformat/network.h libavformat/os_support.c libavformat/os_support.h

ramiro subversion
Wed Aug 8 21:18:10 CEST 2007


Author: ramiro
Date: Wed Aug  8 21:18:10 2007
New Revision: 9988

Log:
Check for winsock2.h instead of __MINGW32__

Modified:
   trunk/configure
   trunk/libavformat/network.h
   trunk/libavformat/os_support.c
   trunk/libavformat/os_support.h

Modified: trunk/configure
==============================================================================
--- trunk/configure	(original)
+++ trunk/configure	Wed Aug  8 21:18:10 2007
@@ -695,6 +695,7 @@ HAVE_LIST="
     sys_soundcard_h
     termios_h
     threads
+    winsock2_h
 "
 
 CMDLINE_SELECT="
@@ -1534,6 +1535,7 @@ check_header termios.h
 check_header conio.h
 
 check_header arpa/inet.h
+check_header winsock2.h
 
 check_func inet_aton
 enabled zlib && check_lib zlib.h zlibVersion -lz || zlib="no"

Modified: trunk/libavformat/network.h
==============================================================================
--- trunk/libavformat/network.h	(original)
+++ trunk/libavformat/network.h	Wed Aug  8 21:18:10 2007
@@ -21,7 +21,7 @@
 #ifndef NETWORK_H
 #define NETWORK_H
 
-#ifdef __MINGW32__
+#ifdef HAVE_WINSOCK2_H
 #include <winsock2.h>
 #include <ws2tcpip.h>
 

Modified: trunk/libavformat/os_support.c
==============================================================================
--- trunk/libavformat/os_support.c	(original)
+++ trunk/libavformat/os_support.c	Wed Aug  8 21:18:10 2007
@@ -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 resolve_host(struct in_addr *sin_add
 
 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 poll(struct pollfd *fds, nfds_t numf
     int n;
     int rc;
 
-#ifdef __MINGW32__
+#ifdef HAVE_WINSOCK2_H
     if (numfds >= FD_SETSIZE) {
         errno = EINVAL;
         return -1;
@@ -107,7 +107,7 @@ int poll(struct pollfd *fds, nfds_t numf
     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;

Modified: trunk/libavformat/os_support.h
==============================================================================
--- trunk/libavformat/os_support.h	(original)
+++ trunk/libavformat/os_support.h	Wed Aug  8 21:18:10 2007
@@ -43,6 +43,9 @@ __declspec(dllimport) void __stdcall Sle
 #  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
 




More information about the ffmpeg-cvslog mailing list