Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Unity
提交
5b1e9818
T
Third Party Unity
项目概览
OpenHarmony
/
Third Party Unity
大约 1 年 前同步成功
通知
34
Star
144
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Unity
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
5b1e9818
编写于
11月 29, 2012
作者:
B
Bryan A. Jones
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix: Clean up UINTY_xxx_WIDTH detection.
Document failing approach (sizeof).
上级
9c4d18d1
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
21 addition
and
23 deletion
+21
-23
src/unity_internals.h
src/unity_internals.h
+21
-23
未找到文件。
src/unity_internals.h
浏览文件 @
5b1e9818
...
...
@@ -10,11 +10,14 @@
#include <stdio.h>
#include <setjmp.h>
//stdint.h is often automatically included.
//Unity uses it to guess at the sizes of integer types, etc.
// Unity attempts to determine sizeof(various types)
// based on UINT_MAX, ULONG_MAX, etc. These are typically
// defined in limits.h.
#ifdef UNITY_USE_LIMITS_H
#include <limits.h>
#endif
// As a fallback, hope that including stdint.h will
// provide this information.
#ifndef UNITY_EXCLUDE_STDINT_H
#include <stdint.h>
#endif
...
...
@@ -23,9 +26,10 @@
// Guess Widths If Not Specified
//-------------------------------------------------------
// If the INT Width hasn't been specified,
// We first try to guess based on UINT_MAX (if it exists)
// Otherwise we fall back on assuming 32-bit
// Determine the size of an int, if not already specificied.
// We cannot use sizeof(int), because it is not yet defined
// at this stage in the trnslation of the C program.
// Therefore, infer it from UINT_MAX if possible.
#ifndef UNITY_INT_WIDTH
#ifdef UINT_MAX
#if (UINT_MAX == 0xFFFF)
...
...
@@ -37,17 +41,16 @@
#ifndef UNITY_SUPPORT_64
#define UNITY_SUPPORT_64
#endif
#else
#define UNITY_INT_WIDTH (32)
#endif
#else
#define UNITY_INT_WIDTH (32)
#endif
#endif
#ifndef UNITY_INT_WIDTH
#define UNITY_INT_WIDTH (32)
#endif
//
If the Long Width hasn't been
specified,
//
We first try to guess based on ULONG_MAX (if it exists)
//
Otherwise we fall back on assuming 32-bit
//
Determine the size of a long, if not already
specified,
//
by following the process used above to define
//
UNITY_INT_WIDTH.
#ifndef UNITY_LONG_WIDTH
#ifdef ULONG_MAX
#if (ULONG_MAX == 0xFFFF)
...
...
@@ -56,20 +59,19 @@
#define UNITY_LONG_WIDTH (32)
#elif (ULONG_MAX == 0xFFFFFFFFFFFFFFFF)
#define UNITY_LONG_WIDTH (64)
#else
#define UNITY_LONG_WIDTH (32)
#ifndef UNITY_SUPPORT_64
#define UNITY_SUPPORT_64
#endif
#endif
#else
#define UNITY_LONG_WIDTH (32)
#endif
#endif
#ifndef UNITY_LONG_WIDTH
#define UNITY_LONG_WIDTH (32)
#endif
//
If the Pointer Width hasn't been
specified,
//
We first try to guess based on INTPTR_MAX (if it exists)
//
Otherwise we fall back on assuming 32-bit
//
Determine the size of a pointer, if not already
specified,
//
by following the process used above to define
//
UNITY_INT_WIDTH.
#ifndef UNITY_POINTER_WIDTH
#ifdef UINTPTR_MAX
#if (UINTPTR_MAX <= 0xFFFF)
...
...
@@ -155,10 +157,6 @@ typedef _US64 _U_SINT;
// Pointer Support
//-------------------------------------------------------
#ifndef UNITY_POINTER_WIDTH
#define UNITY_POINTER_WIDTH (32)
#endif
/* UNITY_POINTER_WIDTH */
#if (UNITY_POINTER_WIDTH == 32)
typedef
_UU32
_UP
;
#define UNITY_DISPLAY_STYLE_POINTER UNITY_DISPLAY_STYLE_HEX32
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录