On 1/14/22, Ozkan Sezer <[email protected]> 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
