summaryrefslogtreecommitdiff
path: root/src/stdafx.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdafx.h')
-rw-r--r--src/stdafx.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/stdafx.h b/src/stdafx.h
index 022ca61e5..3c9419f84 100644
--- a/src/stdafx.h
+++ b/src/stdafx.h
@@ -198,14 +198,16 @@
* call to the same function and is not thread- or reentrancy-safe */
#if !defined(STRGEN)
# if defined(WIN32) || defined(WIN64)
-# if defined(WINCE)
+# include <tchar.h>
/* XXX - WinCE without MSVCRT doesn't support wfopen, so it seems */
-# else
-# define fopen(file, mode) _wfopen(OTTD2FS(file), L ## mode)
-# endif
- const char *FS2OTTD(const wchar_t *name);
- const wchar_t *OTTD2FS(const char *name);
+# if !defined(WINCE)
+# define fopen(file, mode) _tfopen(OTTD2FS(file), _T(mode))
+# endif /* WINCE */
+
+ const char *FS2OTTD(const TCHAR *name);
+ const TCHAR *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);