From fb1f7514887ac4b70443c99235992264dfa5b2cd Mon Sep 17 00:00:00 2001 From: Brian Cox Date: Tue, 28 Jun 2016 22:16:31 -0700 Subject: [PATCH] Build fixes for Android including platform macro & missing mblen() --- src/core/charutil.cpp | 7 +++++++ src/core/platform.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/core/charutil.cpp b/src/core/charutil.cpp index 1bfea90..48326b8 100644 --- a/src/core/charutil.cpp +++ b/src/core/charutil.cpp @@ -41,6 +41,13 @@ #include "charutil.h" #include "ntmbs.h" +#if IS_ANDROID +int mblen(const char *s, size_t n) +{ + return mbtowc(0, s, n); +} +#endif + // // finds the next whole character in string identified by ['cur'-'end') // identifies beginning of char in 'first', then end of character in 'last' diff --git a/src/core/platform.h b/src/core/platform.h index 29d229c..bc70c4d 100644 --- a/src/core/platform.h +++ b/src/core/platform.h @@ -123,7 +123,7 @@ #define IS_DOS_DJGPP 1 -#elif defined(__ANDROID_API__) +#elif defined(__ANDROID__) #define OS OS_ANDROID #define IS_ANDROID 1