[FFmpeg-devel] [PATCH 1/2] avformat/network: add union for avoiding strict aliassing violations with sockaddr*

Michael Niedermayer michaelni at gmx.at
Fri Sep 12 01:52:38 CEST 2014


Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavformat/network.h |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libavformat/network.h b/libavformat/network.h
index d89a62d..d4e1a89 100644
--- a/libavformat/network.h
+++ b/libavformat/network.h
@@ -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;
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list