* af_irda.h: Temporarily redefine u_long as __ms_u_long on LP64 systems.
	* in6addr.h: Ditto.
	* inaddr.h: Ditto.
	* winsock.h: Ditto.
	* winsock2.h: Ditto.
	* psdk_inc/_ip_types.h: Ditto.


git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@5287 4407c894-4637-0410-b4f5-ada5f102cad1
diff --git a/mingw-w64-headers/include/ChangeLog b/mingw-w64-headers/include/ChangeLog
index e661b91..88332de 100644
--- a/mingw-w64-headers/include/ChangeLog
+++ b/mingw-w64-headers/include/ChangeLog
@@ -1,5 +1,14 @@
 2012-07-30  Corinna Vinschen  <vinschen@redhat.com>
 
+	* af_irda.h: Temporarily redefine u_long as __ms_u_long on LP64 systems.
+	* in6addr.h: Ditto.
+	* inaddr.h: Ditto.
+	* winsock.h: Ditto.
+	* winsock2.h: Ditto.
+	* psdk_inc/_ip_types.h: Ditto.
+
+2012-07-30  Corinna Vinschen  <vinschen@redhat.com>
+
 	* Throughout, use __MSABI_LONG macro rather than 'L' qualifier
 	for unsigned numerical constants as well.
 
diff --git a/mingw-w64-headers/include/af_irda.h b/mingw-w64-headers/include/af_irda.h
index d87583b..f2dadb8 100644
--- a/mingw-w64-headers/include/af_irda.h
+++ b/mingw-w64-headers/include/af_irda.h
@@ -6,6 +6,12 @@
 #ifndef __AFIRDA__
 #define __AFIRDA__
 
+#ifdef __LP64__
+#pragma push_macro("u_long")
+#undef u_long
+#define u_long __ms_u_long
+#endif
+
 #include <_bsd_types.h>
 
 #define WINDOWS_AF_IRDA 26
@@ -207,4 +213,8 @@
 typedef WINDOWS_IAS_SET IAS_SET,*PIAS_SET,*LPIASSET;
 typedef WINDOWS_IAS_QUERY IAS_QUERY,*PIAS_QUERY,*LPIASQUERY;
 
+#ifdef __LP64__
+#pragma pop_macro("u_long")
+#endif
+
 #endif
diff --git a/mingw-w64-headers/include/in6addr.h b/mingw-w64-headers/include/in6addr.h
index 5bac1a8..84c806c 100644
--- a/mingw-w64-headers/include/in6addr.h
+++ b/mingw-w64-headers/include/in6addr.h
@@ -6,6 +6,12 @@
 
 #ifndef s6_addr
 
+#ifdef __LP64__
+#pragma push_macro("u_long")
+#undef u_long
+#define u_long __ms_u_long
+#endif
+
 #include <_bsd_types.h>
 
 typedef struct in6_addr {
@@ -32,5 +38,9 @@
 #define s6_addr32       u.__s6_addr32
 #endif
 
+#ifdef __LP64__
+#pragma pop_macro("u_long")
+#endif
+
 #endif /* s6_addr */
 
diff --git a/mingw-w64-headers/include/inaddr.h b/mingw-w64-headers/include/inaddr.h
index 174004e..e513ea6 100644
--- a/mingw-w64-headers/include/inaddr.h
+++ b/mingw-w64-headers/include/inaddr.h
@@ -6,6 +6,12 @@
 
 #ifndef s_addr
 
+#ifdef __LP64__
+#pragma push_macro("u_long")
+#undef u_long
+#define u_long __ms_u_long
+#endif
+
 #include <_bsd_types.h>
 
 typedef struct in_addr {
@@ -23,5 +29,9 @@
 #define s_impno	S_un.S_un_b.s_b4
 #define s_lh	S_un.S_un_b.s_b3
 
+#ifdef __LP64__
+#pragma pop_macro("u_long")
+#endif
+
 #endif /* s_addr */
 
diff --git a/mingw-w64-headers/include/psdk_inc/_ip_types.h b/mingw-w64-headers/include/psdk_inc/_ip_types.h
index 04cba9d..7da85ae 100644
--- a/mingw-w64-headers/include/psdk_inc/_ip_types.h
+++ b/mingw-w64-headers/include/psdk_inc/_ip_types.h
@@ -7,6 +7,12 @@
 #ifndef _MINGW_IP_TYPES_H
 #define _MINGW_IP_TYPES_H
 
+#ifdef __LP64__
+#pragma push_macro("u_long")
+#undef u_long
+#define u_long __ms_u_long
+#endif
+
 #include <_bsd_types.h>
 
 #ifndef __INSIDE_CYGWIN__
@@ -101,5 +107,9 @@
 typedef struct timeval		*PTIMEVAL;
 typedef struct timeval		*LPTIMEVAL;
 
+#ifdef __LP64__
+#pragma pop_macro("u_long")
+#endif
+
 #endif	/* _MINGW_IP_TYPES_H */
 
diff --git a/mingw-w64-headers/include/winsock.h b/mingw-w64-headers/include/winsock.h
index 5ba9d9a..baf8dec 100644
--- a/mingw-w64-headers/include/winsock.h
+++ b/mingw-w64-headers/include/winsock.h
@@ -23,6 +23,12 @@
 #endif /* WINSOCK_API_LINKAGE */
 #define WSAAPI			WINAPI
 
+#ifdef __LP64__
+#pragma push_macro("u_long")
+#undef u_long
+#define u_long __ms_u_long
+#endif
+
 #include <_timeval.h>
 #include <_bsd_types.h>
 #include <inaddr.h>
@@ -358,4 +364,8 @@
 #error WINSOCK2 required.
 #endif
 
+#ifdef __LP64__
+#pragma pop_macro("u_long")
+#endif
+
 #endif /* _WINSOCKAPI_ */
diff --git a/mingw-w64-headers/include/winsock2.h b/mingw-w64-headers/include/winsock2.h
index a15c50f..ed27181 100644
--- a/mingw-w64-headers/include/winsock2.h
+++ b/mingw-w64-headers/include/winsock2.h
@@ -43,6 +43,12 @@
 /* undefine macros from winsock.h */
 #include <psdk_inc/_ws1_undef.h>
 
+#ifdef __LP64__
+#pragma push_macro("u_long")
+#undef u_long
+#define u_long __ms_u_long
+#endif
+
 #include <_timeval.h>
 #include <_bsd_types.h>
 #include <inaddr.h>
@@ -1218,4 +1224,8 @@
 #include <wsipv6ok.h>
 #endif
 
+#ifdef __LP64__
+#pragma pop_macro("u_long")
+#endif
+
 #endif /* _WINSOCK2API_ */