aboutsummaryrefslogtreecommitdiff
path: root/portability.h
diff options
context:
space:
mode:
authorYang Luo <hsluoyz@qq.com>2016-07-29 14:56:21 +0800
committerYang Luo <hsluoyz@qq.com>2016-07-29 16:45:51 +0800
commit853c9a01f838e0f94bb8f80e6fac11d76b4e0efa (patch)
treee80b9d96fbd94f0479ae17ba496ab765061a7f17 /portability.h
parent4cfff8cf340bf745794cf4b05c2f69eb326f029e (diff)
Replace fopen() with fopen_s() on Windows.
Diffstat (limited to 'portability.h')
-rw-r--r--portability.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/portability.h b/portability.h
index 1208dff6..6784af5a 100644
--- a/portability.h
+++ b/portability.h
@@ -87,6 +87,9 @@ char *tokbuf;
strncat_s((x), (z), (y), _TRUNCATE)
#define setbuf(x, y) \
setvbuf((x), (y), _IONBF, 0)
+ #define fopen(x, y) \
+ fopen_safe((x), (y))
+ FILE *fopen_safe(const char *filename, const char* mode);
#else
#define strltok strtok
#endif