mirror of https://github.com/OpenTTD/OpenTTD
(svn r8306) [WinCE] -Fix: some functions don't exists in WinCE, so give an alternative where possible
parent
bb8f3a1dff
commit
4dae672e92
|
@ -1595,7 +1595,13 @@ SaveOrLoadResult SaveOrLoad(const char *filename, int mode)
|
||||||
/* No loader found, treat as version 0 and use LZO format */
|
/* No loader found, treat as version 0 and use LZO format */
|
||||||
if (fmt == endof(_saveload_formats)) {
|
if (fmt == endof(_saveload_formats)) {
|
||||||
DEBUG(sl, 0, "Unknown savegame type, trying to load it as the buggy format");
|
DEBUG(sl, 0, "Unknown savegame type, trying to load it as the buggy format");
|
||||||
|
#if defined(WINCE)
|
||||||
|
/* Of course some system had not to support rewind ;) */
|
||||||
|
fseek(_sl.fh, 0L, SEEK_SET);
|
||||||
|
clearerr(_sl.fh);
|
||||||
|
#else
|
||||||
rewind(_sl.fh);
|
rewind(_sl.fh);
|
||||||
|
#endif
|
||||||
_sl_version = 0;
|
_sl_version = 0;
|
||||||
_sl_minor_version = 0;
|
_sl_minor_version = 0;
|
||||||
fmt = _saveload_formats + 1; // LZO
|
fmt = _saveload_formats + 1; // LZO
|
||||||
|
|
|
@ -157,11 +157,19 @@
|
||||||
# include <stddef.h>
|
# include <stddef.h>
|
||||||
#endif /* defined(_MSC_VER) */
|
#endif /* defined(_MSC_VER) */
|
||||||
|
|
||||||
|
#if defined(WINCE)
|
||||||
|
# define strdup _strdup
|
||||||
|
#endif /* WINCE */
|
||||||
|
|
||||||
/* NOTE: the string returned by these functions is only valid until the next
|
/* 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 */
|
* call to the same function and is not thread- or reentrancy-safe */
|
||||||
#if !defined(STRGEN)
|
#if !defined(STRGEN)
|
||||||
# if defined(WIN32) || defined(WIN64)
|
# if defined(WIN32) || defined(WIN64)
|
||||||
|
# if defined(WINCE)
|
||||||
|
/* XXX - WinCE without MSVCRT doesn't support wfopen, so it seems */
|
||||||
|
# else
|
||||||
# define fopen(file, mode) _wfopen(OTTD2FS(file), L ## mode)
|
# define fopen(file, mode) _wfopen(OTTD2FS(file), L ## mode)
|
||||||
|
# endif
|
||||||
const char *FS2OTTD(const wchar_t *name);
|
const char *FS2OTTD(const wchar_t *name);
|
||||||
const wchar_t *OTTD2FS(const char *name);
|
const wchar_t *OTTD2FS(const char *name);
|
||||||
# else
|
# else
|
||||||
|
|
Loading…
Reference in New Issue