summaryrefslogtreecommitdiffstats
path: root/src/network/socket/qnativesocketengine_p.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-05-04 18:49:41 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-05-22 09:43:16 (GMT)
commit6c1d7e57ee8d7988ab9592e4112b1f28fd1d03ce (patch)
treebad893c68b7c36f2bfaff796f05eecb163e23044 /src/network/socket/qnativesocketengine_p.h
parent815a8c4a297cde2b8f778c4afa36958e324f8ead (diff)
downloadQt-6c1d7e57ee8d7988ab9592e4112b1f28fd1d03ce.zip
Qt-6c1d7e57ee8d7988ab9592e4112b1f28fd1d03ce.tar.gz
Qt-6c1d7e57ee8d7988ab9592e4112b1f28fd1d03ce.tar.bz2
Fixed strict aliasing breaks with sockaddr_XXX structs.
This case it was possible to fix by using a union of the types when we actually declare the variable. Besides, this avoids a bunch of #ifdef for IPv6 functionality. Reviewed-By: Oswald Buddenhagen
Diffstat (limited to 'src/network/socket/qnativesocketengine_p.h')
-rw-r--r--src/network/socket/qnativesocketengine_p.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/network/socket/qnativesocketengine_p.h b/src/network/socket/qnativesocketengine_p.h
index 3366f2d..825c333 100644
--- a/src/network/socket/qnativesocketengine_p.h
+++ b/src/network/socket/qnativesocketengine_p.h
@@ -90,6 +90,15 @@ static inline int qt_socket_socket(int domain, int type, int protocol)
#endif
+union qt_sockaddr {
+ sockaddr a;
+ sockaddr_in a4;
+#if !defined(QT_NO_IPV6)
+ sockaddr_in6 a6;
+#endif
+ sockaddr_storage storage;
+};
+
class QNativeSocketEnginePrivate;
class Q_AUTOTEST_EXPORT QNativeSocketEngine : public QAbstractSocketEngine