From e874be7691eecd1351232386a469215767d9e9c9 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 6 Sep 2014 17:20:45 +0000 Subject: [PATCH] (svn r26769) -Codechange [Squirrel]: remove the difference between some platforms having wchar for SQChar and others just char; always use char (and UTF-8) like in the rest of (internal) OpenTTD --- src/3rdparty/squirrel/include/squirrel.h | 6 +++--- src/script/squirrel.cpp | 4 ++-- src/stdafx.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/3rdparty/squirrel/include/squirrel.h b/src/3rdparty/squirrel/include/squirrel.h index 6da1f744de..650edbe595 100644 --- a/src/3rdparty/squirrel/include/squirrel.h +++ b/src/3rdparty/squirrel/include/squirrel.h @@ -89,9 +89,9 @@ struct SQClass; struct SQInstance; struct SQDelegable; -#ifdef _UNICODE -#define SQUNICODE -#endif +//#ifdef _UNICODE +//#define SQUNICODE +//#endif #ifdef SQUNICODE #if (defined(_MSC_VER) && _MSC_VER >= 1400) // 1400 = VS8 diff --git a/src/script/squirrel.cpp b/src/script/squirrel.cpp index 9c101c7aab..c50a513f36 100644 --- a/src/script/squirrel.cpp +++ b/src/script/squirrel.cpp @@ -31,7 +31,7 @@ void Squirrel::CompileError(HSQUIRRELVM vm, const SQChar *desc, const SQChar *so { SQChar buf[1024]; - scsnprintf(buf, lengthof(buf), _SC("Error %s:") SQ_PRINTF64 _SC("/") SQ_PRINTF64 _SC(": %s"), source, line, column, desc); + seprintf(buf, lastof(buf), "Error %s:" SQ_PRINTF64 "/" SQ_PRINTF64 ": %s", source, line, column, desc); /* Check if we have a custom print function */ Squirrel *engine = (Squirrel *)sq_getforeignptr(vm); @@ -70,7 +70,7 @@ void Squirrel::RunError(HSQUIRRELVM vm, const SQChar *error) /* Check if we have a custom print function */ SQChar buf[1024]; - scsnprintf(buf, lengthof(buf), _SC("Your script made an error: %s\n"), error); + seprintf(buf, lastof(buf), "Your script made an error: %s\n", error); Squirrel *engine = (Squirrel *)sq_getforeignptr(vm); SQPrintFunc *func = engine->print_func; if (func == NULL) { diff --git a/src/stdafx.h b/src/stdafx.h index d0e6fb30ae..cbf2d69f6b 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -301,8 +301,8 @@ const char *FS2OTTD(const TCHAR *name); const TCHAR *OTTD2FS(const char *name, bool console_cp = false); - #define SQ2OTTD(name) FS2OTTD(name) - #define OTTD2SQ(name) OTTD2FS(name) + #define SQ2OTTD(name) (name) + #define OTTD2SQ(name) (name) #else #define fopen(file, mode) fopen(OTTD2FS(file), mode) const char *FS2OTTD(const char *name);