diff options
author | Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org> | 2012-10-15 00:55:50 +0200 |
---|---|---|
committer | Ubuntu <vishal.bhoj@linaro.org> | 2014-06-05 09:54:02 +0000 |
commit | 620eef1a84fd171a858b6cbae023273cfa4379a7 (patch) | |
tree | 99297b0f742bafa30bc6b9afa275a4dac6aff549 | |
parent | fea3a7a54d55587337a9d035b2e3e72cac58785b (diff) | |
download | native-620eef1a84fd171a858b6cbae023273cfa4379a7.tar.gz |
binder: Fix ABI incompatibility between older and newer compilers
Parcel::writeString16's first parameter was a char16_t - defined to
uint16_t somewhere else.
With ISO C++11 compatible compilers, however, char16_t is a
compiler-defined-type that is not necessarily unsigned.
This causes the symbol to be different, breaking support for talking
to binary blobs built with pre-ISO C++11-compilers, such as the
Galaxy Nexus RIL.
Change-Id: Ibaa57fbd7d9fc4a95649d3b45d28d29963a9548b
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
-rw-r--r-- | include/binder/Parcel.h | 2 | ||||
-rw-r--r-- | libs/binder/Parcel.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/include/binder/Parcel.h b/include/binder/Parcel.h index 98f20de21e..15b159240e 100644 --- a/include/binder/Parcel.h +++ b/include/binder/Parcel.h @@ -98,7 +98,7 @@ public: status_t writeCString(const char* str); status_t writeString8(const String8& str); status_t writeString16(const String16& str); - status_t writeString16(const char16_t* str, size_t len); + status_t writeString16(const uint16_t* str, size_t len); status_t writeStrongBinder(const sp<IBinder>& val); status_t writeWeakBinder(const wp<IBinder>& val); status_t writeInt32Array(size_t len, const int32_t *val); diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp index db9e0a1e2a..45a0ff7ce4 100644 --- a/libs/binder/Parcel.cpp +++ b/libs/binder/Parcel.cpp @@ -694,10 +694,10 @@ status_t Parcel::writeString8(const String8& str) status_t Parcel::writeString16(const String16& str) { - return writeString16(str.string(), str.size()); + return writeString16((uint16_t*)str.string(), str.size()); } -status_t Parcel::writeString16(const char16_t* str, size_t len) +status_t Parcel::writeString16(const uint16_t* str, size_t len) { if (str == NULL) return writeInt32(-1); |