[Scummvm-cvs-logs] scummvm master -> 854783ea93d89a28c0bf1617dfd89c84e30d6423
bluegr
md5 at scummvm.org
Fri May 13 19:55:09 CEST 2011
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
854783ea93 SWORD25 (LUA): Hopefully fixed compilation for the Android platform
Commit: 854783ea93d89a28c0bf1617dfd89c84e30d6423
https://github.com/scummvm/scummvm/commit/854783ea93d89a28c0bf1617dfd89c84e30d6423
Author: md5 (md5 at scummvm.org)
Date: 2011-05-13T10:52:33-07:00
Commit Message:
SWORD25 (LUA): Hopefully fixed compilation for the Android platform
Changed paths:
engines/sword25/util/lua/llex.cpp
engines/sword25/util/lua/lvm.cpp
diff --git a/engines/sword25/util/lua/llex.cpp b/engines/sword25/util/lua/llex.cpp
index fdde2b8..91413ba 100644
--- a/engines/sword25/util/lua/llex.cpp
+++ b/engines/sword25/util/lua/llex.cpp
@@ -176,9 +176,17 @@ static void buffreplace (LexState *ls, char from, char to) {
static void trydecpoint (LexState *ls, SemInfo *seminfo) {
/* format error: try to update decimal point separator */
+#if defined(__ANDROID__)
+ // Android is missing the decimal_point member from the lconv struct.
+ // For more information, refer to:
+ // http://www.damonkohler.com/2008/12/lua-on-android.html
+ char old = ls->decpoint;
+ ls->decpoint = '.';
+#else
struct lconv *cv = localeconv();
char old = ls->decpoint;
ls->decpoint = (cv ? cv->decimal_point[0] : '.');
+#endif
buffreplace(ls, old, ls->decpoint); /* try updated decimal separator */
if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r)) {
/* format error with correct decimal point: no more options */
diff --git a/engines/sword25/util/lua/lvm.cpp b/engines/sword25/util/lua/lvm.cpp
index ae70fe2..1501339 100644
--- a/engines/sword25/util/lua/lvm.cpp
+++ b/engines/sword25/util/lua/lvm.cpp
@@ -202,7 +202,14 @@ static int l_strcmp (const TString *ls, const TString *rs) {
const char *r = getstr(rs);
size_t lr = rs->tsv.len;
for (;;) {
+#if defined(__ANDROID__)
+ // Android is missing strcoll().
+ // For more information, refer to:
+ // http://www.damonkohler.com/2008/12/lua-on-android.html
+ int temp = strcmp(l, r);
+#else
int temp = strcoll(l, r);
+#endif
if (temp != 0) return temp;
else { /* strings are equal up to a `\0' */
size_t len = strlen(l); /* index of first `\0' in both strings */
More information about the Scummvm-git-logs
mailing list