Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
df660287
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看板
提交
df660287
编写于
8月 01, 2009
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[HB] Assorted compiler macros
上级
ba8d94ce
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
70 addition
and
22 deletion
+70
-22
src/hb-ot-layout-open-private.h
src/hb-ot-layout-open-private.h
+2
-2
src/hb-private.h
src/hb-private.h
+68
-20
未找到文件。
src/hb-ot-layout-open-private.h
浏览文件 @
df660287
...
...
@@ -215,8 +215,8 @@ struct Null <Type> \
private: char v[BYTES]; \
}; \
ASSERT_SIZE (NAME, BYTES)
#define DEFINE_INT_TYPE0(NAME, type, b) DEFINE_INT_TYPE1 (NAME, type, hb_be_##type, b)
#define DEFINE_INT_TYPE(NAME, u, w) DEFINE_INT_TYPE0 (NAME, u##int##w
##_t
, (w / 8))
#define DEFINE_INT_TYPE0(NAME, type, b) DEFINE_INT_TYPE1 (NAME, type
##_t
, hb_be_##type, b)
#define DEFINE_INT_TYPE(NAME, u, w) DEFINE_INT_TYPE0 (NAME, u##int##w, (w / 8))
DEFINE_INT_TYPE
(
USHORT
,
u
,
16
);
/* 16-bit unsigned integer. */
...
...
src/hb-private.h
浏览文件 @
df660287
...
...
@@ -27,31 +27,29 @@
#ifndef HB_PRIVATE_H
#define HB_PRIVATE_H
#include "hb-common.h"
#include <glib.h>
/* Macros to convert to/from BigEndian */
#define hb_be_uint8_t
#define hb_be_int8_t
#define hb_be_uint16_t GUINT16_TO_BE
#define hb_be_int16_t GINT16_TO_BE
#define hb_be_uint32_t GUINT32_TO_BE
#define hb_be_int32_t GINT32_TO_BE
#define hb_be_uint64_t GUINT64_TO_BE
#define hb_be_int64_t GINT64_TO_BE
#define HB_LIKELY G_LIKELY
#define HB_UNLIKELY G_UNLIKELY
#define HB_UNUSED(arg) ((arg) = (arg))
#define HB_GNUC_UNUSED G_GNUC_UNUSED
#if HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdlib.h>
#include <stdio.h>
/* XXX */
#include <string.h>
#include <assert.h>
#include "hb-common.h"
#include <glib.h>
/* Macros to convert to/from BigEndian */
#define hb_be_uint8
#define hb_be_int8
#define hb_be_uint16 GUINT16_TO_BE
#define hb_be_int16 GINT16_TO_BE
#define hb_be_uint32 GUINT32_TO_BE
#define hb_be_int32 GINT32_TO_BE
#define hb_be_uint64 GUINT64_TO_BE
#define hb_be_int64 GINT64_TO_BE
/* Basics */
#undef MIN
...
...
@@ -83,6 +81,54 @@
#define ASSERT_SIZE(_type, _size) ASSERT_STATIC (sizeof (_type) == (_size))
#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
#define _CAIRO_BOOLEAN_EXPR(expr) \
__extension__ ({ \
int _cairo_boolean_var_; \
if (expr) \
_cairo_boolean_var_ = 1; \
else \
_cairo_boolean_var_ = 0; \
_cairo_boolean_var_; \
})
#define HB_LIKELY(expr) (__builtin_expect (_CAIRO_BOOLEAN_EXPR(expr), 1))
#define HB_UNLIKELY(expr) (__builtin_expect (_CAIRO_BOOLEAN_EXPR(expr), 0))
#else
#define HB_LIKELY(expr) (expr)
#define HB_UNLIKELY(expr) (expr)
#endif
#ifndef __GNUC__
#undef __attribute__
#define __attribute__(x)
#endif
#if __GNUC__ >= 3
#define HB_GNUC_UNUSED __attribute__((unused))
#define HB_GNUC_PURE __attribute__((pure))
#define HB_GNUC_CONST __attribute__((const))
#else
#define HB_GNUC_UNUSED
#define HB_GNUC_PURE
#define HB_GNUC_CONST
#endif
#if (defined(__WIN32__) && !defined(__WINE__)) || defined(_MSC_VER)
#define snprintf _snprintf
#endif
#ifdef _MSC_VER
#undef inline
#define inline __inline
#endif
#ifdef __STRICT_ANSI__
#undef inline
#define inline __inline__
#endif
/* Return the number of 1 bits in mask.
*
* GCC 3.4 supports a "population count" builtin, which on many targets is
...
...
@@ -90,7 +136,7 @@
* in libgcc in case a target does not have one, which should be just as
* good as the open-coded solution below, (which is "HACKMEM 169").
*/
static
inline
unsigned
int
static
HB_GNUC_UNUSED
inline
unsigned
int
_hb_popcount32
(
uint32_t
mask
)
{
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
...
...
@@ -104,6 +150,8 @@ _hb_popcount32 (uint32_t mask)
#endif
}
#include "hb-object-private.h"
#endif
/* HB_PRIVATE_H */
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录