diff options
Diffstat (limited to 'src/3rdparty/freetype/include/freetype/config/public-macros.h')
-rw-r--r-- | src/3rdparty/freetype/include/freetype/config/public-macros.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/3rdparty/freetype/include/freetype/config/public-macros.h b/src/3rdparty/freetype/include/freetype/config/public-macros.h index 6aa673e807..0074134f1d 100644 --- a/src/3rdparty/freetype/include/freetype/config/public-macros.h +++ b/src/3rdparty/freetype/include/freetype/config/public-macros.h @@ -4,7 +4,7 @@ * * Define a set of compiler macros used in public FreeType headers. * - * Copyright (C) 2020 by + * Copyright (C) 2020-2022 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -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<type>(var) +#define FT_REINTERPRET_CAST( type, var ) reinterpret_cast<type>(var) + +#define FT_STATIC_BYTE_CAST( type, var ) \ + static_cast<type>( static_cast<unsigned char>( 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_ */ |