From 2fbf6b732eb2cbe1d73f94af8e9f18adac8aae4f Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Tue, 7 Aug 2012 05:18:24 +0200 Subject: [PATCH] Fix undefined symbols linker error on linux / relwithdebinfo. See http://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Interface.html With this patch, the #pragma will also be used with icc and clang, I didn't test this. --- indra/llcommon/llthread.cpp | 5 +++++ indra/llcommon/llthread.h | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp index 43fe7596e..dd0efb422 100644 --- a/indra/llcommon/llthread.cpp +++ b/indra/llcommon/llthread.cpp @@ -29,6 +29,11 @@ * $/LicenseInfo$ */ +#ifdef __GNUC__ +// Generate code for inlines from llthread.h (needed for is_main_thread()). +#pragma implementation "llthread.h" +#endif + #include "linden_common.h" #include "llapr.h" diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h index cea8c32c2..ef4303a02 100644 --- a/indra/llcommon/llthread.h +++ b/indra/llcommon/llthread.h @@ -33,6 +33,12 @@ #ifndef LL_LLTHREAD_H #define LL_LLTHREAD_H +#ifdef __GNUC__ +// Needed for is_main_thread() when compiling with optimization (relwithdebinfo). +// It doesn't hurt to just always specify it though. +#pragma interface +#endif + #include "llapp.h" #include "llapr.h" #include "llmemory.h" @@ -308,7 +314,7 @@ private: LLMutexBase* mMutex; }; -class AIRWLock +class LL_COMMON_API AIRWLock { public: AIRWLock(LLAPRPool& parent = LLThread::tldata().mRootPool) :