From 114e968482a02b9153d9a236376efb5cd43f4a9a Mon Sep 17 00:00:00 2001 From: "Tareq A. Siraj" Date: Thu, 26 Jul 2012 16:04:24 -0400 Subject: [PATCH] Fixed clang build error for libgui Fixed the order of the statements in ANDROID_SINGLETON_STATIC_INSTANCE macro so that the templated static member variable initialization comes before the instantiation of the Singleton class. This fixes the clang compile error. Change-Id: Ic47d17e152b657f2dff3191ccc3770753fdf002b Author: Tareq A. Siraj Reviewed-by: Edwin Vane --- include/utils/Singleton.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/utils/Singleton.h b/include/utils/Singleton.h index a42ce210d..c60680eab 100644 --- a/include/utils/Singleton.h +++ b/include/utils/Singleton.h @@ -65,9 +65,9 @@ private: */ #define ANDROID_SINGLETON_STATIC_INSTANCE(TYPE) \ - template class Singleton< TYPE >; \ template<> Mutex Singleton< TYPE >::sLock(Mutex::PRIVATE); \ - template<> TYPE* Singleton< TYPE >::sInstance(0); + template<> TYPE* Singleton< TYPE >::sInstance(0); \ + template class Singleton< TYPE >; // ---------------------------------------------------------------------------