From 8eae03992316dadc26f44bc6ffdd90a056ead6d0 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 26 May 2025 08:16:53 +0200 Subject: [PATCH] Lift `FT_Int64` type to global (internal) FreeType use. * src/base/ftcalc.c (FT_Int64) [!FT_INT64]: Move declaration to... * include/freetype/config/integer-types.h: ... this file. (FT_UInt64) [!FT_INT64]: New structure. (FT_INT64_ZERO): New macro. --- include/freetype/config/integer-types.h | 26 ++++++++++++++++++++++++- src/base/ftcalc.c | 12 ------------ 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/include/freetype/config/integer-types.h b/include/freetype/config/integer-types.h index 47534620f..36a0bbc22 100644 --- a/include/freetype/config/integer-types.h +++ b/include/freetype/config/integer-types.h @@ -244,9 +244,33 @@ FT_BEGIN_HEADER #endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */ #ifdef FT_INT64 + typedef FT_INT64 FT_Int64; typedef FT_UINT64 FT_UInt64; -#endif + +# define FT_INT64_ZERO 0 + +#else /* !FT_INT64 */ + + /* we need to emulate 64-bit data types if none are available */ + + typedef struct FT_Int64_ + { + FT_UInt32 lo; + FT_UInt32 hi; + + } FT_Int64; + + typedef struct FT_UInt64_ + { + FT_UInt32 lo; + FT_UInt32 hi; + + } FT_UInt64; + +# define FT_INT64_ZERO { 0, 0 } + +#endif /* !FT_INT64 */ FT_END_HEADER diff --git a/src/base/ftcalc.c b/src/base/ftcalc.c index 3f363c5ec..4004d0622 100644 --- a/src/base/ftcalc.c +++ b/src/base/ftcalc.c @@ -43,18 +43,6 @@ #undef FT_MulFix #endif - /* we need to emulate a 64-bit data type if one isn't available */ -#ifndef FT_INT64 - - typedef struct FT_Int64_ - { - FT_UInt32 lo; - FT_UInt32 hi; - - } FT_Int64; - -#endif /* !FT_INT64 */ - /************************************************************************** *