summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2014-09-06 17:36:29 +0000
committerrubidium <rubidium@openttd.org>2014-09-06 17:36:29 +0000
commitad315ef6d906100550a0ba12a7ca71b329804966 (patch)
treea46cc38347a0752f4bc35e1dc5f8177ac8b064f7
parent7c4e9dd71d6f02f686c52551ccdcc27b89ef8025 (diff)
downloadopenttd-ad315ef6d906100550a0ba12a7ca71b329804966.tar.xz
(svn r26772) -Cleanup [Squirrel]: remove traces to SQUNICODE define
-rw-r--r--src/3rdparty/squirrel/etc/minimal.c4
-rw-r--r--src/3rdparty/squirrel/include/squirrel.h41
-rw-r--r--src/3rdparty/squirrel/sq/sq.c24
-rw-r--r--src/3rdparty/squirrel/sqstdlib/sqstdio.cpp4
-rw-r--r--src/3rdparty/squirrel/sqstdlib/sqstdstring.cpp6
-rw-r--r--src/3rdparty/squirrel/sqstdlib/sqstdsystem.cpp9
-rw-r--r--src/3rdparty/squirrel/squirrel/sqstate.h4
7 files changed, 0 insertions, 92 deletions
diff --git a/src/3rdparty/squirrel/etc/minimal.c b/src/3rdparty/squirrel/etc/minimal.c
index fc59859f8..e6bdd0e89 100644
--- a/src/3rdparty/squirrel/etc/minimal.c
+++ b/src/3rdparty/squirrel/etc/minimal.c
@@ -10,11 +10,7 @@
#pragma comment (lib ,"sqstdlib.lib")
#endif
-#ifdef SQUNICODE
-#define scvprintf vwprintf
-#else
#define scvprintf vprintf
-#endif
void printfunc(HSQUIRRELVM v, const SQChar *s, ...)
{
diff --git a/src/3rdparty/squirrel/include/squirrel.h b/src/3rdparty/squirrel/include/squirrel.h
index 650edbe59..84f34dea9 100644
--- a/src/3rdparty/squirrel/include/squirrel.h
+++ b/src/3rdparty/squirrel/include/squirrel.h
@@ -89,46 +89,6 @@ struct SQClass;
struct SQInstance;
struct SQDelegable;
-//#ifdef _UNICODE
-//#define SQUNICODE
-//#endif
-
-#ifdef SQUNICODE
-#if (defined(_MSC_VER) && _MSC_VER >= 1400) // 1400 = VS8
-
-#ifndef _WCHAR_T_DEFINED //this is if the compiler considers wchar_t as native type
-typedef unsigned short wchar_t;
-#endif
-#endif
-
-typedef wchar_t SQChar;
-#define _SC(a) L##a
-#define scstrcmp wcscmp
-#define scsprintf swprintf
-#define scsnprintf _snwprintf
-#define scstrlen wcslen
-#define scstrtod wcstod
-#define scstrtol wcstol
-#define scatoi _wtoi
-#define scstrtoul wcstoul
-#define scvsprintf vswprintf
-#define scstrstr wcsstr
-#define scisspace iswspace
-#define scisdigit iswdigit
-#define scisxdigit iswxdigit
-#define scisalpha iswalpha
-#define sciscntrl iswcntrl
-#define scisalnum iswalnum
-#define scprintf wprintf
-#define scfprintf fwprintf
-#define scvprintf vwprintf
-#define scvfprintf vfwprintf
-#define scvsnprintf _vsnwprintf
-#define scstrdup _wcsdup
-#define scstrrchr wcsrchr
-#define scstrcat wcscat
-#define MAX_CHAR 0xFFFF
-#else
typedef char SQChar;
#define _SC(a) a
#define scstrcmp strcmp
@@ -156,7 +116,6 @@ typedef char SQChar;
#define scstrrchr strrchr
#define scstrcat strcat
#define MAX_CHAR 0xFFFF
-#endif
#if defined(_MSC_VER) || defined(__MINGW32__)
#define SQ_PRINTF64 _SC("%I64d")
diff --git a/src/3rdparty/squirrel/sq/sq.c b/src/3rdparty/squirrel/sq/sq.c
index 0a4e48f14..c1c3e501e 100644
--- a/src/3rdparty/squirrel/sq/sq.c
+++ b/src/3rdparty/squirrel/sq/sq.c
@@ -17,15 +17,9 @@
#include <sqstdstring.h>
#include <sqstdaux.h>
-#ifdef SQUNICODE
-#define scfprintf fwprintf
-#define scfopen _wfopen
-#define scvprintf vwprintf
-#else
#define scfprintf fprintf
#define scfopen fopen
#define scvprintf vprintf
-#endif
void PrintVersionInfos();
@@ -131,12 +125,7 @@ int getargs(HSQUIRRELVM v,int argc, char* argv[])
if(arg<argc) {
const SQChar *filename=NULL;
-#ifdef SQUNICODE
- mbstowcs(temp,argv[arg],strlen(argv[arg]));
- filename=temp;
-#else
filename=argv[arg];
-#endif
arg++;
sq_pushroottable(v);
@@ -145,14 +134,7 @@ int getargs(HSQUIRRELVM v,int argc, char* argv[])
for(i=arg;i<argc;i++)
{
const SQChar *a;
-#ifdef SQUNICODE
- int alen=(int)strlen(argv[i]);
- a=sq_getscratchpad(v,(int)(alen*sizeof(SQChar)));
- mbstowcs(sq_getscratchpad(v,-1),argv[i],alen);
- sq_getscratchpad(v,-1)[alen] = _SC('\0');
-#else
a=argv[i];
-#endif
sq_pushstring(v,a,-1);
sq_arrayappend(v,-2);
@@ -163,13 +145,7 @@ int getargs(HSQUIRRELVM v,int argc, char* argv[])
if(SQ_SUCCEEDED(sqstd_loadfile(v,filename,SQTrue))){
SQChar *outfile = _SC("out.cnut");
if(output) {
-#ifdef SQUNICODE
- int len = (int)(strlen(output)+1);
- mbstowcs(sq_getscratchpad(v,len*sizeof(SQChar)),output,len);
- outfile = sq_getscratchpad(v,-1);
-#else
outfile = output;
-#endif
}
if(SQ_SUCCEEDED(sqstd_writeclosuretofile(v,outfile)))
return _DONE;
diff --git a/src/3rdparty/squirrel/sqstdlib/sqstdio.cpp b/src/3rdparty/squirrel/sqstdlib/sqstdio.cpp
index 217205e5c..28b3503e2 100644
--- a/src/3rdparty/squirrel/sqstdlib/sqstdio.cpp
+++ b/src/3rdparty/squirrel/sqstdlib/sqstdio.cpp
@@ -9,11 +9,7 @@
//basic API
SQFILE sqstd_fopen(const SQChar *filename ,const SQChar *mode)
{
-#ifndef SQUNICODE
return (SQFILE)fopen(filename,mode);
-#else
- return (SQFILE)_wfopen(filename,mode);
-#endif
}
SQInteger sqstd_fread(void* buffer, SQInteger size, SQInteger count, SQFILE file)
diff --git a/src/3rdparty/squirrel/sqstdlib/sqstdstring.cpp b/src/3rdparty/squirrel/sqstdlib/sqstdstring.cpp
index 681029aa7..8ec264906 100644
--- a/src/3rdparty/squirrel/sqstdlib/sqstdstring.cpp
+++ b/src/3rdparty/squirrel/sqstdlib/sqstdstring.cpp
@@ -8,15 +8,9 @@
#include <assert.h>
#include <stdarg.h>
-#ifdef SQUNICODE
-#define scstrchr wcschr
-#define scatoi _wtoi
-#define scstrtok wcstok
-#else
#define scstrchr strchr
#define scatoi atoi
#define scstrtok strtok
-#endif
#define MAX_FORMAT_LEN 20
#define MAX_WFORMAT_LEN 3
#define ADDITIONAL_FORMAT_SPACE (100*sizeof(SQChar))
diff --git a/src/3rdparty/squirrel/sqstdlib/sqstdsystem.cpp b/src/3rdparty/squirrel/sqstdlib/sqstdsystem.cpp
index e1fcdfbd9..70bc097be 100644
--- a/src/3rdparty/squirrel/sqstdlib/sqstdsystem.cpp
+++ b/src/3rdparty/squirrel/sqstdlib/sqstdsystem.cpp
@@ -5,20 +5,11 @@
#include <stdio.h>
#include <sqstdsystem.h>
-#ifdef SQUNICODE
-#include <wchar.h>
-#define scgetenv _wgetenv
-#define scsystem _wsystem
-#define scasctime _wasctime
-#define scremove _wremove
-#define screname _wrename
-#else
#define scgetenv getenv
#define scsystem system
#define scasctime asctime
#define scremove remove
#define screname rename
-#endif
static SQInteger _system_getenv(HSQUIRRELVM v)
{
diff --git a/src/3rdparty/squirrel/squirrel/sqstate.h b/src/3rdparty/squirrel/squirrel/sqstate.h
index 302f68611..ea48aca91 100644
--- a/src/3rdparty/squirrel/squirrel/sqstate.h
+++ b/src/3rdparty/squirrel/squirrel/sqstate.h
@@ -123,11 +123,7 @@ private:
#define _instance_ddel _table(_sharedstate->_instance_default_delegate)
#define _weakref_ddel _table(_sharedstate->_weakref_default_delegate)
-#ifdef SQUNICODE //rsl REAL STRING LEN
-#define rsl(l) ((l)<<1)
-#else
#define rsl(l) (l)
-#endif
extern SQObjectPtr _null_;
extern SQObjectPtr _true_;