avformat/network: add union for avoiding strict aliassing violations with sockaddr*
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 11 Sep 2014 23:52:38 +0000 (01:52 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 15 Sep 2014 11:31:00 +0000 (13:31 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/network.h

index d89a62daa3517df7adee476371fc830140b9864c..d4e1a894cb9bc3a742f0116fc4747eb3c8b1c6c9 100644 (file)
@@ -72,6 +72,14 @@ int ff_neterrno(void);
 #include <poll.h>
 #endif
 
+typedef union sockaddr_union {
+    struct sockaddr_storage storage;
+    struct sockaddr_in in;
+#if HAVE_STRUCT_SOCKADDR_IN6
+    struct sockaddr_in6 in6;
+#endif
+} sockaddr_union;
+
 int ff_socket_nonblock(int socket, int enable);
 
 extern int ff_network_inited_globally;