summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/freetype/include/freetype/config/public-macros.h
diff options
context:
space:
mode:
authorTarja Sundqvist <tarja.sundqvist@qt.io>2023-06-09 17:30:54 +0300
committerTarja Sundqvist <tarja.sundqvist@qt.io>2023-06-09 17:30:54 +0300
commitda6e958319e95fe564d3b30c931492dd666bfaff (patch)
tree16ac1556a573daeba5c9c4b795f86aa166ffe467 /src/3rdparty/freetype/include/freetype/config/public-macros.h
parent29400a683f96867133b28299c0d0bd6bcf40df35 (diff)
parenta96fc76fa78f3500266b3a34016f9e1bd29b319c (diff)
Merge remote-tracking branch 'origin/tqtc/lts-5.15.11' into tqtc/lts-5.15-opensourcev5.15.11-lts-lgpl
Diffstat (limited to 'src/3rdparty/freetype/include/freetype/config/public-macros.h')
-rw-r--r--src/3rdparty/freetype/include/freetype/config/public-macros.h20
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_ */