From d6c9f644ac62ec83196a75a47655a33a87875628 Mon Sep 17 00:00:00 2001 From: Bo Yang Date: Fri, 24 Apr 2015 15:34:40 -0700 Subject: internal changes Change-Id: I66f216c70a19f44637090878d7e442d4d0f8991b --- src/google/protobuf/arena.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/google/protobuf/arena.h') diff --git a/src/google/protobuf/arena.h b/src/google/protobuf/arena.h index bb15e80c..b48bef92 100644 --- a/src/google/protobuf/arena.h +++ b/src/google/protobuf/arena.h @@ -373,6 +373,11 @@ class LIBPROTOBUF_EXPORT Arena { // Thread local variables cannot be exposed through DLL interface but we can // wrap them in static functions. static ThreadCache& thread_cache(); +#elif defined(GOOGLE_PROTOBUF_OS_ANDROID) || defined(GOOGLE_PROTOBUF_OS_IPHONE) + // Android ndk does not support __thread keyword so we use a custom thread + // local storage class we implemented. + // iOS also does not support the __thread keyword. + static ThreadCache& thread_cache(); #else static GOOGLE_THREAD_LOCAL ThreadCache thread_cache_; static ThreadCache& thread_cache() { return thread_cache_; } -- cgit v1.2.3