Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
a00a63b5
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
1 年多 前同步成功
通知
0
Star
18
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Harfbuzz
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a00a63b5
编写于
6月 06, 2012
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add macros to check that types are POD
上级
61eb60c1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
45 addition
and
12 deletion
+45
-12
configure.ac
configure.ac
+1
-0
src/hb-open-type-private.hh
src/hb-open-type-private.hh
+20
-12
src/hb-private.hh
src/hb-private.hh
+24
-0
未找到文件。
configure.ac
浏览文件 @
a00a63b5
...
...
@@ -137,6 +137,7 @@ PKG_CHECK_MODULES(ICU, icu, have_icu=true, [
AC_SUBST(ICU_LIBS)
fi
])
have_icu=false
if $have_icu; then
AC_DEFINE(HAVE_ICU, 1, [Have ICU library])
fi
...
...
src/hb-open-type-private.hh
浏览文件 @
a00a63b5
...
...
@@ -80,17 +80,25 @@ inline Type& StructAfter(TObject &X)
*/
/* Check _assertion in a method environment */
#define _DEFINE_SIZE_ASSERTION(_assertion) \
inline void _size_assertion (void) const \
{ ASSERT_STATIC (_assertion); }
#define _DEFINE_INSTANCE_ASSERTION1(_line, _assertion) \
inline void _instance_assertion_on_line_##_line (void) const \
{ \
ASSERT_STATIC (_assertion); \
ASSERT_INSTANCE_POD (*this);
/* Make sure it's POD. */
\
}
# define _DEFINE_INSTANCE_ASSERTION0(_line, _assertion) _DEFINE_INSTANCE_ASSERTION1 (_line, _assertion)
# define DEFINE_INSTANCE_ASSERTION(_assertion) _DEFINE_INSTANCE_ASSERTION0 (__LINE__, _assertion)
/* Check that _code compiles in a method environment */
#define _DEFINE_COMPILES_ASSERTION
(
_code) \
inline void _compiles_assertion (void) const \
#define _DEFINE_COMPILES_ASSERTION
1(_line,
_code) \
inline void _compiles_assertion
_on_line_##_line
(void) const \
{ _code; }
# define _DEFINE_COMPILES_ASSERTION0(_line, _code) _DEFINE_COMPILES_ASSERTION1 (_line, _code)
# define DEFINE_COMPILES_ASSERTION(_code) _DEFINE_COMPILES_ASSERTION0 (__LINE__, _code)
#define DEFINE_SIZE_STATIC(size) \
_DEFINE_SIZ
E_ASSERTION (sizeof (*this) == (size)); \
DEFINE_INSTANC
E_ASSERTION (sizeof (*this) == (size)); \
static const unsigned int static_size = (size); \
static const unsigned int min_size = (size)
...
...
@@ -98,21 +106,21 @@ inline Type& StructAfter(TObject &X)
#define VAR 1
#define DEFINE_SIZE_UNION(size, _member) \
_DEFINE_SIZ
E_ASSERTION (this->u._member.static_size == (size)); \
DEFINE_INSTANC
E_ASSERTION (this->u._member.static_size == (size)); \
static const unsigned int min_size = (size)
#define DEFINE_SIZE_MIN(size) \
_DEFINE_SIZ
E_ASSERTION (sizeof (*this) >= (size)); \
DEFINE_INSTANC
E_ASSERTION (sizeof (*this) >= (size)); \
static const unsigned int min_size = (size)
#define DEFINE_SIZE_ARRAY(size, array) \
_DEFINE_SIZ
E_ASSERTION (sizeof (*this) == (size) + sizeof (array[0])); \
_
DEFINE_COMPILES_ASSERTION ((void) array[0].static_size) \
DEFINE_INSTANC
E_ASSERTION (sizeof (*this) == (size) + sizeof (array[0])); \
DEFINE_COMPILES_ASSERTION ((void) array[0].static_size) \
static const unsigned int min_size = (size)
#define DEFINE_SIZE_ARRAY2(size, array1, array2) \
_DEFINE_SIZ
E_ASSERTION (sizeof (*this) == (size) + sizeof (this->array1[0]) + sizeof (this->array2[0])); \
_
DEFINE_COMPILES_ASSERTION ((void) array1[0].static_size; (void) array2[0].static_size) \
DEFINE_INSTANC
E_ASSERTION (sizeof (*this) == (size) + sizeof (this->array1[0]) + sizeof (this->array2[0])); \
DEFINE_COMPILES_ASSERTION ((void) array1[0].static_size; (void) array2[0].static_size) \
static const unsigned int min_size = (size)
...
...
src/hb-private.hh
浏览文件 @
a00a63b5
...
...
@@ -104,6 +104,30 @@ ASSERT_STATIC (sizeof (hb_position_t) == 4);
ASSERT_STATIC
(
sizeof
(
hb_mask_t
)
==
4
);
ASSERT_STATIC
(
sizeof
(
hb_var_int_t
)
==
4
);
/* We like our types POD */
#define _ASSERT_TYPE_POD1(_line, _type) union _type_##_type##_on_line_##_line##_is_not_POD { _type instance; }
#define _ASSERT_TYPE_POD0(_line, _type) _ASSERT_TYPE_POD1 (_line, _type)
#define ASSERT_TYPE_POD(_type) _ASSERT_TYPE_POD0 (__LINE__, _type)
#ifdef __GNUC__
# define _ASSERT_INSTANCE_POD1(_line, _instance) union _type_of_instance_on_line_##_line##_is_not_POD { __typeof__(_instance) instance; }
#else
# define _ASSERT_INSTANCE_POD1(_line, _instance) typedef int _assertion_on_line_##_line##_not_tested
#endif
# define _ASSERT_INSTANCE_POD0(_line, _instance) _ASSERT_INSTANCE_POD1 (_line, _instance)
# define ASSERT_INSTANCE_POD(_instance) _ASSERT_INSTANCE_POD0 (__LINE__, _instance)
/* Check _assertion in a method environment */
#define _ASSERT_POD1(_line) \
inline void _static_assertion_on_line_##_line (void) const \
{ _ASSERT_INSTANCE_POD1 (*this);
/* Make sure it's POD. */
}
# define _ASSERT_POD0(_line) _ASSERT_POD1 (_line)
# define ASSERT_POD() _ASSERT_POD0 (__LINE__)
/* Misc */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录