freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Two build fixes for watcom compiler:


From: Ozkan Sezer
Subject: Re: Two build fixes for watcom compiler:
Date: Fri, 14 Jan 2022 10:49:18 +0300

On 1/14/22, Ozkan Sezer <sezeroz@gmail.com> wrote:
>>>  __cdecl comes from Windows. See
>>> https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/qsort
>>
>
> And actually, that whole cdecl thing only to satisfy windows is
> overzealous, i.e. you only need to satisfy MSVC / x86, i.e. can
> be simplified to an  #if defined(_MSC_VER) && defined(_M_IX86)
> and even that shouldn't have been necessary because the windows
> msvc (and mingw which follows msvc) default calling convention
> is cdecl already.

OK, seen https://gitlab.freedesktop.org/freetype/freetype/-/issues/1026
so the proper fix would be like the following:

diff --git a/include/freetype/internal/compiler-macros.h
b/include/freetype/internal/compiler-macros.h
index 88c0bf0..91f8a60 100644
--- a/include/freetype/internal/compiler-macros.h
+++ b/include/freetype/internal/compiler-macros.h
@@ -301,8 +301,10 @@ FT_BEGIN_HEADER

 #if defined( __i386__ )
 #define FT_COMPARE_DEF( x )  FT_CALLBACK_DEF( x ) __attribute__(( cdecl ))
-#elif defined( _M_IX86 )
+#elif defined( _M_IX86 ) && !defined( __WATCOMC__ )
 #define FT_COMPARE_DEF( x )  FT_CALLBACK_DEF( x ) __cdecl
+#elif defined( __WATCOMC__ )
+#define FT_COMPARE_DEF( x )  FT_CALLBACK_DEF( x ) __watcall
 #else
 #define FT_COMPARE_DEF( x )  FT_CALLBACK_DEF( x )
 #endif



reply via email to

[Prev in Thread] Current Thread [Next in Thread]