From 5c43f54af84675103ebb7757252fe064411dc021 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 19 Dec 2011 11:46:44 +0100 Subject: [PATCH] At least GCC 4.5.1 does not allow #pragma GCC diagnostic inside functions. --- sal/osl/unx/thread.c | 39 +++++++++++++-------------------------- 1 file changed, 13 insertions(+), 26 deletions(-) diff --git a/sal/osl/unx/thread.c b/sal/osl/unx/thread.c index 766cf0615244..b5d80f135423 100644 --- a/sal/osl/unx/thread.c +++ b/sal/osl/unx/thread.c @@ -237,6 +237,14 @@ static void osl_thread_cleanup_Impl (void* pData) /*****************************************************************************/ /* osl_thread_start_Impl */ /*****************************************************************************/ +#if defined __GNUC__ +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2) +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +#pragma GCC diagnostic push +#endif +#pragma GCC diagnostic ignored "-Wshadow" +#endif +#endif static void* osl_thread_start_Impl (void* pData) { int terminate; @@ -247,20 +255,7 @@ static void* osl_thread_start_Impl (void* pData) pthread_mutex_lock (&(pImpl->m_Lock)); /* install cleanup handler */ -#if defined __GNUC__ -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2) -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) -#pragma GCC diagnostic push -#endif -#pragma GCC diagnostic ignored "-Wshadow" -#endif -#endif pthread_cleanup_push (osl_thread_cleanup_Impl, pData); -#if defined __GNUC__ -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) -#pragma GCC diagnostic pop -#endif -#endif /* request oslThreadIdentifier @@@ see TODO @@@ */ pImpl->m_Ident = insertThreadId (pImpl->m_hThread); @@ -274,20 +269,7 @@ static void* osl_thread_start_Impl (void* pData) while (pImpl->m_Flags & THREADIMPL_FLAGS_SUSPENDED) { /* wait until SUSPENDED flag is cleared */ -#if defined __GNUC__ -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2) -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) -#pragma GCC diagnostic push -#endif -#pragma GCC diagnostic ignored "-Wshadow" -#endif -#endif pthread_cleanup_push (osl_thread_wait_cleanup_Impl, &(pImpl->m_Lock)); -#if defined __GNUC__ -#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) -#pragma GCC diagnostic pop -#endif -#endif pthread_cond_wait (&(pImpl->m_Cond), &(pImpl->m_Lock)); pthread_cleanup_pop (0); } @@ -307,6 +289,11 @@ static void* osl_thread_start_Impl (void* pData) pthread_cleanup_pop (1); return (0); } +#if defined __GNUC__ +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) +#pragma GCC diagnostic pop +#endif +#endif /*****************************************************************************/ /* osl_thread_create_Impl */