summaryrefslogtreecommitdiffstats
path: root/tools/aapt/StringPool.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/aapt/StringPool.cpp')
-rw-r--r--tools/aapt/StringPool.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/tools/aapt/StringPool.cpp b/tools/aapt/StringPool.cpp
index e3ec0ae..a18e9f1 100644
--- a/tools/aapt/StringPool.cpp
+++ b/tools/aapt/StringPool.cpp
@@ -26,6 +26,7 @@
// Set to true for noisy debug output.
static const bool kIsDebug = false;
+#if __cplusplus >= 201103L
void strcpy16_htod(char16_t* dst, const char16_t* src)
{
while (*src) {
@@ -35,6 +36,17 @@ void strcpy16_htod(char16_t* dst, const char16_t* src)
}
*dst = 0;
}
+#endif
+
+void strcpy16_htod(uint16_t* dst, const char16_t* src)
+{
+ while (*src) {
+ uint16_t s = htods(static_cast<uint16_t>(*src));
+ *dst++ = s;
+ src++;
+ }
+ *dst = 0;
+}
void printStringPool(const ResStringPool* pool)
{
@@ -434,7 +446,7 @@ status_t StringPool::writeStringBlock(const sp<AaptFile>& pool)
return NO_MEMORY;
}
- const size_t charSize = mUTF8 ? sizeof(uint8_t) : sizeof(char16_t);
+ const size_t charSize = mUTF8 ? sizeof(uint8_t) : sizeof(uint16_t);
size_t strPos = 0;
for (i=0; i<STRINGS; i++) {