[FFmpeg-devel] [PATCH/RFC] Prefer getaddrinfo over gethostbyname

Ronald S. Bultje rsbultje
Tue Jan 12 20:02:57 CET 2010


Hi,

On Tue, Jan 12, 2010 at 1:05 PM, Martin Storsj? <martin at martin.st> wrote:
> On Tue, 12 Jan 2010, Ronald S. Bultje wrote:
>> On Tue, Jan 12, 2010 at 12:46 PM, Martin Storsj? <martin at martin.st> wrote:
>> > On Tue, 12 Jan 2010, Ronald S. Bultje wrote:
>> >> On what systems is sockaddr_storage not defined?
>> >
>> > On none of the systems I normally use; a quick check shows that it should
>> > be available on windows/mingw, mingw32ce (windows ce), linux, os x and
>> > android.
>> >
>> > So in that sense, this is quite a small issue...
>>
>> So why did we do this? :-). I'm tempted to remove it until some poor
>> soul complains.
>
> Ok, don't let me stop you, then. Having no definition at all at least is
> better than having an incorrect one, in that it is much easier to notice.

Attached.

Ronald
-------------- next part --------------
Index: configure
===================================================================
--- configure	(revision 21148)
+++ configure	(working copy)
@@ -990,7 +990,6 @@
     soundcard_h
     poll_h
     struct_addrinfo
-    struct_sockaddr_storage
     sys_mman_h
     sys_resource_h
     sys_select_h
@@ -2452,7 +2451,6 @@
 if enabled network; then
     check_type "sys/types.h sys/socket.h" socklen_t
     check_type netdb.h "struct addrinfo"
-    check_type sys/socket.h "struct sockaddr_storage"
     # Prefer arpa/inet.h over winsock2
     if check_header arpa/inet.h ; then
         check_func closesocket
@@ -2463,7 +2461,6 @@
             network_extralibs="-lws2_32"; }
         check_type ws2tcpip.h socklen_t
         check_type ws2tcpip.h "struct addrinfo"
-        check_type ws2tcpip.h "struct sockaddr_storage"
     else
         disable network
     fi
Index: libavformat/network.h
===================================================================
--- libavformat/network.h	(revision 21150)
+++ libavformat/network.h	(working copy)
@@ -68,12 +68,6 @@
 int inet_aton (const char * str, struct in_addr * add);
 #endif
 
-#if !HAVE_STRUCT_SOCKADDR_STORAGE
-struct sockaddr_storage {
-    struct sockaddr_in x;
-};
-#endif
-
 #if !HAVE_STRUCT_ADDRINFO
 struct addrinfo {
     int ai_flags;



More information about the ffmpeg-devel mailing list