diff options
author | Brian Carlstrom <bdc@google.com> | 2010-09-16 16:28:13 -0700 |
---|---|---|
committer | Brian Carlstrom <bdc@google.com> | 2010-09-16 16:28:13 -0700 |
commit | dbb7b6da080782d032251c1ab181145eaa3fc2b2 (patch) | |
tree | 246aec8711aa8e1ac7f9a28d838622e17904f2c6 /libs/ui | |
parent | a7516e90d01a22d17a470695eefa905e0ff066cc (diff) | |
download | frameworks_base-dbb7b6da080782d032251c1ab181145eaa3fc2b2.zip frameworks_base-dbb7b6da080782d032251c1ab181145eaa3fc2b2.tar.gz frameworks_base-dbb7b6da080782d032251c1ab181145eaa3fc2b2.tar.bz2 |
Fix sim-eng build on Hardy
Older glibc version do not include BSD htole32 and htole64 which are
present in bionic. This worksaround a sim-eng build issue by only
using htole32/htole64 if the host is not little endian.
Change-Id: Ia8d0d36285f3c34c51a331790458e52a21c2925f
Diffstat (limited to 'libs/ui')
-rw-r--r-- | libs/ui/GraphicLog.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libs/ui/GraphicLog.cpp b/libs/ui/GraphicLog.cpp index b55ce23..7ba2779 100644 --- a/libs/ui/GraphicLog.cpp +++ b/libs/ui/GraphicLog.cpp @@ -30,7 +30,11 @@ ANDROID_SINGLETON_STATIC_INSTANCE(GraphicLog) static inline void writeInt32(uint8_t* base, size_t& pos, int32_t value) { +#ifdef HAVE_LITTLE_ENDIAN + int32_t v = value; +#else int32_t v = htole32(value); +#endif base[pos] = EVENT_TYPE_INT; memcpy(&base[pos+1], &v, sizeof(int32_t)); pos += 1+sizeof(int32_t); @@ -38,7 +42,11 @@ void writeInt32(uint8_t* base, size_t& pos, int32_t value) { static inline void writeInt64(uint8_t* base, size_t& pos, int64_t value) { +#ifdef HAVE_LITTLE_ENDIAN + int64_t v = value; +#else int64_t v = htole64(value); +#endif base[pos] = EVENT_TYPE_LONG; memcpy(&base[pos+1], &v, sizeof(int64_t)); pos += 1+sizeof(int64_t); |