From 4ee9d04bd5d518e5f1f86875f4f8184fc0552f44 Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Fri, 3 Dec 2021 04:03:12 +0000 Subject: freetype 2.11.1 git-svn-id: svn://tug.org/texlive/trunk@61211 c570f23f-e606-0410-a88d-b1316a301751 --- .../include/freetype/config/ftstdlib.h | 12 ++++++- .../include/freetype/config/integer-types.h | 38 ++++++++++++---------- .../include/freetype/config/public-macros.h | 18 ++++++++++ 3 files changed, 50 insertions(+), 18 deletions(-) (limited to 'Build/source/libs/freetype2/freetype-src/include/freetype/config') diff --git a/Build/source/libs/freetype2/freetype-src/include/freetype/config/ftstdlib.h b/Build/source/libs/freetype2/freetype-src/include/freetype/config/ftstdlib.h index fea21ffa4df..6ee412a074f 100644 --- a/Build/source/libs/freetype2/freetype-src/include/freetype/config/ftstdlib.h +++ b/Build/source/libs/freetype2/freetype-src/include/freetype/config/ftstdlib.h @@ -43,7 +43,8 @@ * * `UINT_MAX` and `ULONG_MAX` are used to automatically compute the size of * `int` and `long` in bytes at compile-time. So far, this works for all - * platforms the library has been tested on. + * platforms the library has been tested on. We also check `ULLONG_MAX` + * to see whether we can use 64-bit `long long` later on. * * Note that on the extremely rare platforms that do not provide integer * types that are _exactly_ 16 and 32~bits wide (e.g., some old Crays where @@ -66,6 +67,15 @@ #define FT_LONG_MIN LONG_MIN #define FT_LONG_MAX LONG_MAX #define FT_ULONG_MAX ULONG_MAX +#ifdef LLONG_MAX +#define FT_LLONG_MAX LLONG_MAX +#endif +#ifdef LLONG_MIN +#define FT_LLONG_MIN LLONG_MIN +#endif +#ifdef ULLONG_MAX +#define FT_ULLONG_MAX ULLONG_MAX +#endif /************************************************************************** diff --git a/Build/source/libs/freetype2/freetype-src/include/freetype/config/integer-types.h b/Build/source/libs/freetype2/freetype-src/include/freetype/config/integer-types.h index 4bb3eedab40..5ef09f1978b 100644 --- a/Build/source/libs/freetype2/freetype-src/include/freetype/config/integer-types.h +++ b/Build/source/libs/freetype2/freetype-src/include/freetype/config/integer-types.h @@ -60,6 +60,18 @@ #endif /* !defined(FT_SIZEOF_LONG) */ +#ifndef FT_SIZEOF_LONG_LONG + + /* The size of a `long long` type if available */ +#if defined( FT_ULLONG_MAX ) && FT_ULLONG_MAX >= 0xFFFFFFFFFFFFFFFFULL +#define FT_SIZEOF_LONG_LONG ( 64 / FT_CHAR_BIT ) +#else +#define FT_SIZEOF_LONG_LONG 0 +#endif + +#endif /* !defined(FT_SIZEOF_LONG_LONG) */ + + /************************************************************************** * * @section: @@ -174,15 +186,17 @@ #endif - /* determine whether we have a 64-bit `int` type for platforms without */ - /* Autoconf */ + /* determine whether we have a 64-bit integer type */ #if FT_SIZEOF_LONG == ( 64 / FT_CHAR_BIT ) - /* `FT_LONG64` must be defined if a 64-bit type is available */ -#define FT_LONG64 #define FT_INT64 long #define FT_UINT64 unsigned long +#elif FT_SIZEOF_LONG_LONG >= ( 64 / FT_CHAR_BIT ) + +#define FT_INT64 long long int +#define FT_UINT64 unsigned long long int + /************************************************************************** * * A 64-bit data type may create compilation problems if you compile in @@ -192,16 +206,9 @@ */ #elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 ) -#if defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L - -#define FT_LONG64 -#define FT_INT64 long long int -#define FT_UINT64 unsigned long long int - -#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */ +#if defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */ /* this compiler provides the `__int64` type */ -#define FT_LONG64 #define FT_INT64 __int64 #define FT_UINT64 unsigned __int64 @@ -211,7 +218,6 @@ /* to test the compiler version. */ /* this compiler provides the `__int64` type */ -#define FT_LONG64 #define FT_INT64 __int64 #define FT_UINT64 unsigned __int64 @@ -221,22 +227,20 @@ #elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */ -#define FT_LONG64 #define FT_INT64 long long int #define FT_UINT64 unsigned long long int #elif defined( __GNUC__ ) /* GCC provides the `long long` type */ -#define FT_LONG64 #define FT_INT64 long long int #define FT_UINT64 unsigned long long int -#endif /* __STDC_VERSION__ >= 199901L */ +#endif /* !__STDC__ */ #endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */ -#ifdef FT_LONG64 +#ifdef FT_INT64 typedef FT_INT64 FT_Int64; typedef FT_UINT64 FT_UInt64; #endif diff --git a/Build/source/libs/freetype2/freetype-src/include/freetype/config/public-macros.h b/Build/source/libs/freetype2/freetype-src/include/freetype/config/public-macros.h index 51fbc9c2f52..9fbb3274a0e 100644 --- a/Build/source/libs/freetype2/freetype-src/include/freetype/config/public-macros.h +++ b/Build/source/libs/freetype2/freetype-src/include/freetype/config/public-macros.h @@ -103,6 +103,7 @@ FT_BEGIN_HEADER */ #define FT_EXPORT( x ) FT_PUBLIC_FUNCTION_ATTRIBUTE extern x + /* * `FT_UNUSED` indicates that a given parameter is not used -- this is * only used to get rid of unpleasant compiler warnings. @@ -115,6 +116,23 @@ FT_BEGIN_HEADER #endif + /* + * Support for casts in both C and C++. + */ +#ifdef __cplusplus +#define FT_STATIC_CAST( type, var ) static_cast(var) +#define FT_REINTERPRET_CAST( type, var ) reinterpret_cast(var) + +#define FT_STATIC_BYTE_CAST( type, var ) \ + static_cast( static_cast( var ) ) +#else +#define FT_STATIC_CAST( type, var ) (type)(var) +#define FT_REINTERPRET_CAST( type, var ) (type)(var) + +#define FT_STATIC_BYTE_CAST( type, var ) (type)(unsigned char)(var) +#endif + + FT_END_HEADER #endif /* FREETYPE_CONFIG_PUBLIC_MACROS_H_ */ -- cgit v1.2.3