summaryrefslogtreecommitdiff
path: root/win32.h
diff options
context:
space:
mode:
Diffstat (limited to 'win32.h')
-rw-r--r--win32.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/win32.h b/win32.h
index 8353e173c..ceff0ec26 100644
--- a/win32.h
+++ b/win32.h
@@ -8,12 +8,19 @@ bool MyShowCursor(bool show);
typedef void (*Function)(int);
bool LoadLibraryList(Function proc[], const char *dll);
+char *convert_from_fs(const wchar_t *name, char *utf8_buf, size_t buflen);
+wchar_t *convert_to_fs(const char *name, wchar_t *utf16_buf, size_t buflen);
+
#if defined(UNICODE)
-# define MB_TO_WIDE(x) OTTD2FS(x)
-# define WIDE_TO_MB(x) FS2OTTD(x)
+# define MB_TO_WIDE(str) OTTD2FS(str)
+# define MB_TO_WIDE_BUFFER(str, buffer, buflen) convert_to_fs(str, buffer, buflen)
+# define WIDE_TO_MB(str) FS2OTTD(str)
+# define WIDE_TO_MB_BUFFER(str, buffer, buflen) convert_from_fs(str, buffer, buflen)
#else
-# define MB_TO_WIDE(x) (x)
-# define WIDE_TO_MB(x) (x)
+# define MB_TO_WIDE(str) (str)
+# define MB_TO_WIDE_BUFFER(str, buffer, buflen) (str)
+# define WIDE_TO_MB(str) (str)
+# define WIDE_TO_MB_BUFFER(str, buffer, buflen) (str)
#endif
#endif /* WIN32_H */