Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
itdan3344
stb
提交
65ebe751
S
stb
项目概览
itdan3344
/
stb
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
stb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
65ebe751
编写于
7月 02, 2015
作者:
L
Liam Chasteen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Tweaked to enable compilation under MinGW.
上级
b53c08a1
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
11 addition
and
4 deletion
+11
-4
stb.h
stb.h
+11
-4
未找到文件。
stb.h
浏览文件 @
65ebe751
...
...
@@ -190,6 +190,9 @@ Parenthesized items have since been removed.
#include <stdio.h> // need FILE
#include <string.h> // stb_define_hash needs memcpy/memset
#include <time.h> // stb_dirtree
#ifdef __MINGW32__
#include <fcntl.h> // O_RDWR
#endif
#ifdef STB_PERSONAL
typedef
int
Bool
;
...
...
@@ -1395,7 +1398,7 @@ int stb_is_pow2(unsigned int n)
// tricky use of 4-bit table to identify 5 bit positions (note the '-1')
// 3-bit table would require another tree level; 5-bit table wouldn't save one
#if
def _WIN32
#if
defined(_WIN32) && !defined(__MINGW32__)
#pragma warning(push)
#pragma warning(disable: 4035) // disable warning about no return value
int
stb_log2_floor
(
unsigned
int
n
)
...
...
@@ -5049,7 +5052,7 @@ void stb_fwrite32(FILE *f, stb_uint32 x)
fwrite
(
&
x
,
4
,
1
,
f
);
}
#if
def _MSC_VER
#if
defined(_MSC_VER) || defined(__MINGW32__)
#define stb__stat _stat
#else
#define stb__stat stat
...
...
@@ -5389,7 +5392,11 @@ FILE * stb_fopen(char *filename, char *mode)
#else
{
strcpy
(
temp_full
+
p
,
"stmpXXXXXX"
);
int
fd
=
mkstemp
(
temp_full
);
#ifdef __MINGW32__
int
fd
=
open
(
mktemp
(
temp_full
),
O_RDWR
);
#else
int
fd
=
mkstemp
(
temp_full
);
#endif
if
(
fd
==
-
1
)
return
NULL
;
f
=
fdopen
(
fd
,
mode
);
if
(
f
==
NULL
)
{
...
...
@@ -6988,7 +6995,7 @@ stb_dirtree *stb_dirtree_get_dir(char *dir, char *cache_dir)
stb_sha1
(
sha
,
(
unsigned
char
*
)
dir_lower
,
strlen
(
dir_lower
));
strcpy
(
cache_file
,
cache_dir
);
s
=
cache_file
+
strlen
(
cache_file
);
if
(
s
[
-
1
]
!=
'
/
/
' && s[-1] != '\\') *s++ = '/';
if
(
s
[
-
1
]
!=
'/'
&&
s
[
-
1
]
!=
'\\'
)
*
s
++
=
'/'
;
strcpy
(
s
,
"dirtree_"
);
s
+=
strlen
(
s
);
for
(
i
=
0
;
i
<
8
;
++
i
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录