1. include/freetype/internal/compiler-macros.h (FT_CALLBACK_DEF):
don't define as __cdecl for Watcom builds.
Otherwise, conflicts happen with Watcom default calling convention
which is 'watcall'. E.g.:
src/base/ftrfork.c(292): Error! E1071: Type of parameter 4 does not
agree with previous definition
src/base/ftrfork.c(292): Note! I2003: source conversion type is 'int
(__cdecl *)(void const *__p1,void const *__p2)'
src/base/ftrfork.c(292): Note! I2004: target conversion type is 'int
(*)(void const *__p1,void const *__p2)'
src/base/ftrfork.c(292): Note! I2002: 'qsort' defined in:
/opt/watcom/h/stdlib.h(213)
2. src/sdf/ftbsdf.c: undefine 'near' for Watcom builds
Watcom defines near to its __near keyword and build fails otherwise:
src/sdf/ftbsdf.c(598): Error! E1016: Expecting identifier
src/sdf/ftbsdf.c(602): Error! E1016: Expecting identifier
src/sdf/ftbsdf.c(602): Error! E1151: Parameter count does not agree
with previous definition
src/sdf/ftbsdf.c(602): Note! I2002: 'FT_Vector_Length' defined in:
include/freetype/fttrigon.h(288)
src/sdf/ftbsdf.c(608): Error! E1016: Expecting identifier
src/sdf/ftbsdf.c(609): Error! E1016: Expecting identifier
src/sdf/ftbsdf.c(876): Error! E1016: Expecting identifier
src/sdf/ftbsdf.c(885): Error! E1016: Expecting identifier
Patches are attached.
Regards.
--
O.S.
include/freetype/internal/compiler-macros.h (FT_CALLBACK_DEF):
don't define as __cdecl for Watcom builds.
Otherwise, conflicts happen with Watcom default calling convention
which is 'watcall'. E.g.:
src/base/ftrfork.c(292): Error! E1071: Type of parameter 4 does not agree with previous definition
src/base/ftrfork.c(292): Note! I2003: source conversion type is 'int (__cdecl *)(void const *__p1,void const *__p2)'
src/base/ftrfork.c(292): Note! I2004: target conversion type is 'int (*)(void const *__p1,void const *__p2)'
src/base/ftrfork.c(292): Note! I2002: 'qsort' defined in: /opt/watcom/h/stdlib.h(213)
diff --git a/include/freetype/internal/compiler-macros.h b/include/freetype/internal/compiler-macros.h
index 88c0bf0..0328a52 100644
--- a/include/freetype/internal/compiler-macros.h
+++ b/include/freetype/internal/compiler-macros.h
@@ -301,7 +301,7 @@ 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
#else
#define FT_COMPARE_DEF( x ) FT_CALLBACK_DEF( x )
src/sdf/ftbsdf.c: undefine 'near' for Watcom builds
Watcom defines near to its __near keyword and build fails otherwise:
src/sdf/ftbsdf.c(598): Error! E1016: Expecting identifier
src/sdf/ftbsdf.c(602): Error! E1016: Expecting identifier
src/sdf/ftbsdf.c(602): Error! E1151: Parameter count does not agree with previous definition
src/sdf/ftbsdf.c(602): Note! I2002: 'FT_Vector_Length' defined in: include/freetype/fttrigon.h(288)
src/sdf/ftbsdf.c(608): Error! E1016: Expecting identifier
src/sdf/ftbsdf.c(609): Error! E1016: Expecting identifier
src/sdf/ftbsdf.c(876): Error! E1016: Expecting identifier
src/sdf/ftbsdf.c(885): Error! E1016: Expecting identifier
diff --git a/src/sdf/ftbsdf.c b/src/sdf/ftbsdf.c
index fac3c3e..813dd64 100644
--- a/src/sdf/ftbsdf.c
+++ b/src/sdf/ftbsdf.c
@@ -191,6 +191,9 @@
* of a pixel.
*
*/
+ #ifdef __WATCOMC__
+ #undef near
+ #endif
typedef struct ED_
{
FT_16D16 dist;