Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
f60f2166
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f60f2166
编写于
4月 21, 2010
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Move macros around
上级
649a4344
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
62 addition
and
60 deletion
+62
-60
src/hb-private.h
src/hb-private.h
+62
-60
未找到文件。
src/hb-private.h
浏览文件 @
f60f2166
...
...
@@ -47,66 +47,6 @@
#include "hb-common.h"
/* We need external help for these */
#ifdef HAVE_GLIB
#include <glib.h>
typedef
int
hb_atomic_int_t
;
#define hb_atomic_int_fetch_and_add(AI, V) g_atomic_int_exchange_and_add (&(AI), V)
#define hb_atomic_int_get(AI) g_atomic_int_get (&(AI))
#define hb_atomic_int_set(AI, V) g_atomic_int_set (&(AI), V)
typedef
GStaticMutex
hb_mutex_t
;
#define HB_MUTEX_INIT G_STATIC_MUTEX_INIT
#define hb_mutex_init(M) g_static_mutex_init (&M)
#define hb_mutex_lock(M) g_static_mutex_lock (&M)
#define hb_mutex_trylock(M) g_static_mutex_trylock (&M)
#define hb_mutex_unlock(M) g_static_mutex_unlock (&M)
#else
#ifdef _MSC_VER
#pragma message(__LOC__"Could not find any system to define platform macros, library will NOT be thread-safe")
#else
#warning "Could not find any system to define platform macros, library will NOT be thread-safe"
#endif
typedef
int
hb_atomic_int_t
;
#define hb_atomic_int_fetch_and_add(AI, V) ((AI) += (V), (AI) - (V))
#define hb_atomic_int_get(AI) (AI)
#define hb_atomic_int_set(AI, V) do { (AI) = (V); } while (0)
typedef
int
hb_mutex_t
;
#define HB_MUTEX_INIT 0
#define hb_mutex_init(M) do { (M) = 0; } while (0)
#define hb_mutex_lock(M) do { (M) = 1; } while (0)
#define hb_mutex_trylock(M) ((M) = 1, 1)
#define hb_mutex_unlock(M) do { (M) = 0; } while (0)
#endif
/* Big-endian handling */
#define hb_be_uint16(v) ((uint16_t) ((((const uint8_t *)&(v))[0] << 8) + (((const uint8_t *)&(v))[1])))
#define hb_be_uint16_put_unaligned(v,V) (v[0] = (V>>8), v[1] = (V), 0)
#define hb_be_uint16_get_unaligned(v) (uint16_t) ((v[0] << 8) + v[1])
#define hb_be_uint16_cmp_unaligned(a,b) (a[0] == b[0] && a[1] == b[1])
#define hb_be_int16_put_unaligned hb_be_uint16_put_unaligned
#define hb_be_int16_get_unaligned (int16_t) hb_be_uint16_get_unaligned
#define hb_be_int16_cmp_unaligned hb_be_uint16_cmp_unaligned
#define hb_be_uint32_put_unaligned(v,V) (v[0] = (V>>24), v[1] = (V>>16), v[2] = (V>>8), v[3] = (V), 0)
#define hb_be_uint32_get_unaligned(v) (uint32_t) ((v[0] << 24) + (v[1] << 16) + (v[2] << 8) + v[3])
#define hb_be_uint32_cmp_unaligned(a,b) (a[0] == b[0] && a[1] == b[1] && a[2] == b[2] && a[3] == b[3])
#define hb_be_int32_put_unaligned hb_be_uint32_put_unaligned
#define hb_be_int32_get_unaligned (int32_t) hb_be_uint32_get_unaligned
#define hb_be_int32_cmp_unaligned hb_be_uint32_cmp_unaligned
/* Basics */
#undef MIN
...
...
@@ -230,6 +170,68 @@ _hb_popcount32 (uint32_t mask)
/* Multiplies a 16dot16 value by another value, then truncates the result */
#define _hb_16dot16_mul_round(A,B) (((int64_t) (A) * (B) + 0x8000) / 0x10000)
/* We need external help for these */
#ifdef HAVE_GLIB
#include <glib.h>
typedef
int
hb_atomic_int_t
;
#define hb_atomic_int_fetch_and_add(AI, V) g_atomic_int_exchange_and_add (&(AI), V)
#define hb_atomic_int_get(AI) g_atomic_int_get (&(AI))
#define hb_atomic_int_set(AI, V) g_atomic_int_set (&(AI), V)
typedef
GStaticMutex
hb_mutex_t
;
#define HB_MUTEX_INIT G_STATIC_MUTEX_INIT
#define hb_mutex_init(M) g_static_mutex_init (&M)
#define hb_mutex_lock(M) g_static_mutex_lock (&M)
#define hb_mutex_trylock(M) g_static_mutex_trylock (&M)
#define hb_mutex_unlock(M) g_static_mutex_unlock (&M)
#else
#ifdef _MSC_VER
#pragma message(__LOC__"Could not find any system to define platform macros, library will NOT be thread-safe")
#else
#warning "Could not find any system to define platform macros, library will NOT be thread-safe"
#endif
typedef
int
hb_atomic_int_t
;
#define hb_atomic_int_fetch_and_add(AI, V) ((AI) += (V), (AI) - (V))
#define hb_atomic_int_get(AI) (AI)
#define hb_atomic_int_set(AI, V) do { (AI) = (V); } while (0)
typedef
int
hb_mutex_t
;
#define HB_MUTEX_INIT 0
#define hb_mutex_init(M) do { (M) = 0; } while (0)
#define hb_mutex_lock(M) do { (M) = 1; } while (0)
#define hb_mutex_trylock(M) ((M) = 1, 1)
#define hb_mutex_unlock(M) do { (M) = 0; } while (0)
#endif
/* Big-endian handling */
#define hb_be_uint16(v) ((uint16_t) ((((const uint8_t *)&(v))[0] << 8) + (((const uint8_t *)&(v))[1])))
#define hb_be_uint16_put_unaligned(v,V) (v[0] = (V>>8), v[1] = (V), 0)
#define hb_be_uint16_get_unaligned(v) (uint16_t) ((v[0] << 8) + v[1])
#define hb_be_uint16_cmp_unaligned(a,b) (a[0] == b[0] && a[1] == b[1])
#define hb_be_int16_put_unaligned hb_be_uint16_put_unaligned
#define hb_be_int16_get_unaligned (int16_t) hb_be_uint16_get_unaligned
#define hb_be_int16_cmp_unaligned hb_be_uint16_cmp_unaligned
#define hb_be_uint32_put_unaligned(v,V) (v[0] = (V>>24), v[1] = (V>>16), v[2] = (V>>8), v[3] = (V), 0)
#define hb_be_uint32_get_unaligned(v) (uint32_t) ((v[0] << 24) + (v[1] << 16) + (v[2] << 8) + v[3])
#define hb_be_uint32_cmp_unaligned(a,b) (a[0] == b[0] && a[1] == b[1] && a[2] == b[2] && a[3] == b[3])
#define hb_be_int32_put_unaligned hb_be_uint32_put_unaligned
#define hb_be_int32_get_unaligned (int32_t) hb_be_uint32_get_unaligned
#define hb_be_int32_cmp_unaligned hb_be_uint32_cmp_unaligned
#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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录