From: Chip Davis Subject: [PATCH 1/2] include: Only define __msvcrt_long to int for LP64. Message-Id: <20191125022655.51480-1-cdavis@codeweavers.com> Date: Sun, 24 Nov 2019 20:26:54 -0600 This is the only place that's needed. Everywhere else can use 'long'. This avoids a bunch of warnings from Clang about common standard library functions having the wrong prototypes. Signed-off-by: Chip Davis --- include/msvcrt/corecrt.h | 5 +++++ include/msvcrt/math.h | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/include/msvcrt/corecrt.h b/include/msvcrt/corecrt.h index c88d3e0570d..10e60d564c3 100644 --- a/include/msvcrt/corecrt.h +++ b/include/msvcrt/corecrt.h @@ -142,8 +142,13 @@ #ifndef _MSVCRT_LONG_DEFINED #define _MSVCRT_LONG_DEFINED /* we need 32-bit longs even on 64-bit */ +#ifdef __LP64__ typedef int __msvcrt_long; typedef unsigned int __msvcrt_ulong; +#else +typedef long __msvcrt_long; +typedef unsigned long __msvcrt_ulong; +#endif #endif #ifndef _INTPTR_T_DEFINED diff --git a/include/msvcrt/math.h b/include/msvcrt/math.h index 76601de853a..68b6922458f 100644 --- a/include/msvcrt/math.h +++ b/include/msvcrt/math.h @@ -96,10 +96,10 @@ float __cdecl rintf(float); float __cdecl roundf(float); float __cdecl truncf(float); -long __cdecl lrint(double); -long __cdecl lrintf(float); -long __cdecl lround(double); -long __cdecl lroundf(float); +__msvcrt_long __cdecl lrint(double); +__msvcrt_long __cdecl lrintf(float); +__msvcrt_long __cdecl lround(double); +__msvcrt_long __cdecl lroundf(float); double __cdecl _copysign (double, double); double __cdecl _chgsign (double); -- 2.21.0