summaryrefslogtreecommitdiff
path: root/stdafx.h
diff options
context:
space:
mode:
Diffstat (limited to 'stdafx.h')
-rw-r--r--stdafx.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/stdafx.h b/stdafx.h
index 00823e188..5d2d58103 100644
--- a/stdafx.h
+++ b/stdafx.h
@@ -154,6 +154,19 @@
# include <stddef.h>
#endif /* defined(_MSC_VER) */
+/* NOTE: the string returned by these functions is only valid until the next
+ * call to the same function and is not thread- or reentrancy-safe */
+#if !defined(STRGEN)
+# if defined(WIN32) || defined(WIN64)
+# define fopen(file, mode) _wfopen(OTTD2FS(file), L ## mode)
+ const char *FS2OTTD(const wchar_t *name);
+ const wchar_t *OTTD2FS(const char *name);
+# else
+# define fopen(file, mode) fopen(OTTD2FS(file), mode)
+ const char *FS2OTTD(const char *name);
+ const char *OTTD2FS(const char *name);
+# endif /* WIN32 */
+#endif /* STRGEN */
// Windows has always LITTLE_ENDIAN
#if defined(WIN32) || defined(__OS2__) || defined(WIN64)