summaryrefslogtreecommitdiff
path: root/src/script/rapidjson/file.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/rapidjson/file.hpp')
-rw-r--r--src/script/rapidjson/file.hpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/script/rapidjson/file.hpp b/src/script/rapidjson/file.hpp
new file mode 100644
index 0000000..5e098d4
--- /dev/null
+++ b/src/script/rapidjson/file.hpp
@@ -0,0 +1,21 @@
+#ifndef __LUA_RAPIDJSION_FILE_HPP__
+#define __LUA_RAPIDJSION_FILE_HPP__
+
+#include <cstdio>
+
+namespace file
+{
+ inline FILE* open(const char* filename, const char* mode)
+ {
+#if WIN32
+ FILE* fp = nullptr;
+ fopen_s(&fp, filename, mode);
+ return fp;
+#else
+ return fopen(filename, mode);
+#endif
+ }
+}
+
+#endif
+