From 8e83c663d9f654b6fa411e54ed6d3bdb1c940a29 Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Sun, 15 Jun 2014 09:33:40 +0300 Subject: [PATCH] Use _WIN32 instead of WIN32 to check for Windows MinGW defines both _WIN32 and WIN32 (and may even be the only compiler doing so). Microsoft and Intel compilers only define _WIN32. Use the common one to eliminate the need in defining WIN32 explicitly. --- prop_sheets/debug-2012.props | 2 +- prop_sheets/release-2012.props | 2 +- utp_internal.h | 2 +- utp_types.h | 4 ++-- utp_utils.cpp | 10 +++++----- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/prop_sheets/debug-2012.props b/prop_sheets/debug-2012.props index 4a46b12..56d81c4 100644 --- a/prop_sheets/debug-2012.props +++ b/prop_sheets/debug-2012.props @@ -11,7 +11,7 @@ Level3 - _DEBUG;WIN32;ENABLE_I18N;ENABLE_SRP=1;%(PreprocessorDefinitions) + _DEBUG;ENABLE_I18N;ENABLE_SRP=1;%(PreprocessorDefinitions) false false false diff --git a/prop_sheets/release-2012.props b/prop_sheets/release-2012.props index 59073ae..4ed6a12 100644 --- a/prop_sheets/release-2012.props +++ b/prop_sheets/release-2012.props @@ -27,7 +27,7 @@ StdCall Default false - NDEBUG;WIN32;ENABLE_I18N;ENABLE_SRP=1;%(PreprocessorDefinitions) + NDEBUG;ENABLE_I18N;ENABLE_SRP=1;%(PreprocessorDefinitions) false c:\temp\$(ProjectName)-$(ConfigurationName)-$(PlatformName)-master.pch true diff --git a/utp_internal.h b/utp_internal.h index 6418146..d6de03c 100644 --- a/utp_internal.h +++ b/utp_internal.h @@ -44,7 +44,7 @@ enum bandwidth_type_t { header_overhead, retransmit_overhead }; -#ifdef WIN32 +#ifdef _WIN32 #ifdef _MSC_VER #include "libutp_inet_ntop.h" #endif diff --git a/utp_types.h b/utp_types.h index 9799ad1..8e51e1c 100644 --- a/utp_types.h +++ b/utp_types.h @@ -42,7 +42,7 @@ // hash.cpp needs socket definitions, which is why this networking specific // code is inclued in utypes.h -#ifdef WIN32 +#ifdef _WIN32 #define _CRT_SECURE_NO_DEPRECATE #define WIN32_LEAN_AND_MEAN #include @@ -76,7 +76,7 @@ typedef struct sockaddr_storage SOCKADDR_STORAGE; #endif -#ifdef WIN32 +#ifdef _WIN32 #define I64u "%I64u" #else #define I64u "%Lu" diff --git a/utp_utils.cpp b/utp_utils.cpp index f2c57ab..e8c6deb 100644 --- a/utp_utils.cpp +++ b/utp_utils.cpp @@ -25,12 +25,12 @@ #include "utp.h" #include "utp_types.h" -#ifdef WIN32 +#ifdef _WIN32 #define WIN32_LEAN_AND_MEAN #include #include #include -#else //!WIN32 +#else //!_WIN32 #include #include // Linux needs both time.h and sys/time.h #endif @@ -41,7 +41,7 @@ #include "utp_utils.h" -#ifdef WIN32 +#ifdef _WIN32 typedef ULONGLONG (WINAPI GetTickCount64Proc)(void); static GetTickCount64Proc *pt2GetTickCount64; @@ -113,7 +113,7 @@ static inline uint64 UTP_GetMilliseconds() return GetTickCount(); } -#else //!WIN32 +#else //!_WIN32 static inline uint64 UTP_GetMicroseconds(void); static inline uint64 UTP_GetMilliseconds() @@ -182,7 +182,7 @@ static uint64_t __GetMicroseconds() #endif //!__APPLE__ -#endif //!WIN32 +#endif //!_WIN32 /* * Whew. Okay. After that #ifdef maze above, we now know we have a working