ref: 11ea89b51c8a3e1d81e0dbec47d6909ff60c9a1d
parent: ba5d661f34b0f0e16785dd97bf7d828a050e33c9
author: Ozkan Sezer <sezeroz@gmail.com>
date: Fri Jan 14 17:07:44 EST 2022
Add Watcom C/C++ support. * include/freetype/config/integer-types.h: Make sure `long long` is used then available. * include/freetype/internal/ftcalc.h (FT_MSB): Add Watcom C/C++ pragma.
--- a/include/freetype/config/integer-types.h
+++ b/include/freetype/config/integer-types.h
@@ -221,9 +221,10 @@
#define FT_INT64 __int64
#define FT_UINT64 unsigned __int64
-#elif defined( __WATCOMC__ ) /* Watcom C++ */
+#elif defined( __WATCOMC__ ) && __WATCOMC__ >= 1100 /* Watcom C++ */
- /* Watcom doesn't provide 64-bit data types */
+#define FT_INT64 long long int
+#define FT_UINT64 unsigned long long int
#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */
--- a/include/freetype/internal/ftcalc.h
+++ b/include/freetype/internal/ftcalc.h
@@ -408,6 +408,19 @@
#endif
+#elif defined( __WATCOMC__ ) && defined( __386__ )
+
+ extern __inline FT_Int32
+ FT_MSB_i386( FT_UInt32 x );
+
+#pragma aux FT_MSB_i386 = \
+ "bsr eax, eax" \
+ parm [eax] nomemory \
+ value [eax] \
+ modify exact [eax] nomemory;
+
+#define FT_MSB( x ) FT_MSB_i386( x )
+
#elif defined( __DECC ) || defined( __DECCXX )
#include <builtins.h>