From 4ed049cc7bfa0eb4dbdd10880babaf5fc9f37add Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Mon, 12 Aug 2013 01:12:25 +0000 Subject: [PATCH] [CMAKE] - Define i386 on x86 MSVC builds - Probably fixes the infamous MSVC networking issues caused by tcpip.h assuming it was a big-endian platform and never byte-swapping anything [TCPIP][LAN] - Fix byteswapping on AMD64 and ARM builds too svn path=/trunk/; revision=59704 --- reactos/CMakeLists.txt | 2 +- reactos/drivers/network/lan/include/net_wh.h | 6 +++--- reactos/drivers/network/tcpip/include/tcpip.h | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/reactos/CMakeLists.txt b/reactos/CMakeLists.txt index d0c83d73e4d..861e5959b1c 100644 --- a/reactos/CMakeLists.txt +++ b/reactos/CMakeLists.txt @@ -142,7 +142,7 @@ else() # Arch Options if(ARCH STREQUAL "i386") - add_definitions(-D_M_IX86 -D_X86_ -D__i386__) + add_definitions(-D_M_IX86 -D_X86_ -D__i386__ -Di386) elseif(ARCH STREQUAL "amd64") add_definitions(-D_M_AMD64 -D_AMD64_ -D__x86_64__ -D_WIN64) elseif(ARCH STREQUAL "arm") diff --git a/reactos/drivers/network/lan/include/net_wh.h b/reactos/drivers/network/lan/include/net_wh.h index b4736131836..d6bd215b4b1 100644 --- a/reactos/drivers/network/lan/include/net_wh.h +++ b/reactos/drivers/network/lan/include/net_wh.h @@ -1,6 +1,6 @@ #pragma once -#ifdef i386 +#if defined(i386) || defined(_AMD64_) || defined(_ARM_) /* DWORD network to host byte order conversion for i386 */ #define DN2H(dw) \ @@ -26,7 +26,7 @@ ((((w) & 0xFF00) >> 8) | \ (((w) & 0x00FF) << 8)) -#else /* i386 */ +#else /* defined(i386) || defined(_AMD64_) || defined(_ARM_) */ /* DWORD network to host byte order conversion for other architectures */ #define DN2H(dw) \ @@ -44,4 +44,4 @@ #define WH2N(w) \ (w) -#endif /* i386 */ +#endif /* defined(i386) || defined(_AMD64_) || defined(_ARM_) */ diff --git a/reactos/drivers/network/tcpip/include/tcpip.h b/reactos/drivers/network/tcpip/include/tcpip.h index 3ab12050931..88c7e063cb9 100644 --- a/reactos/drivers/network/tcpip/include/tcpip.h +++ b/reactos/drivers/network/tcpip/include/tcpip.h @@ -65,7 +65,7 @@ #define NDIS_BUFFER_TAG FOURCC('n','b','u','f') #define NDIS_PACKET_TAG FOURCC('n','p','k','t') -#ifdef i386 +#if defined(i386) || defined(_AMD64_) || defined(_ARM_) /* DWORD network to host byte order conversion for i386 */ #define DN2H(dw) \ @@ -91,7 +91,7 @@ ((((w) & 0xFF00) >> 8) | \ (((w) & 0x00FF) << 8)) -#else /* i386 */ +#else /* defined(i386) || defined(_AMD64_) || defined(_ARM_) */ #error Unsupported architecture @@ -111,7 +111,7 @@ #define WH2N(w) \ (w) -#endif /* i386 */ +#endif /* defined(i386) || defined(_AMD64_) || defined(_ARM_) */ /* AF_INET and other things Arty likes to use ;) */ #define AF_INET 2