mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-07 14:58:22 +00:00
b789cacb40
into a predefined buffer insted of using the static (global) buffer. This is useful if the converted value will be used later on; no need to copy it somewhere else to save it. -CodeChange: [win32] Added appropiate macros WIDE_TO_MB_BUFFER, MB_TO_WIDE_BUFFER next to existing WIDE_TO_MB and MB_TO_WIDE that only do work when UNICODE is defined, saves #ifdefs all over the place
27 lines
787 B
C
27 lines
787 B
C
/* $Id$ */
|
|
|
|
#ifndef WIN32_H
|
|
#define WIN32_H
|
|
|
|
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(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(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 */
|