From 870f89ac4a7b67ada3d6d042ce81c4fc65d95c07 Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Fri, 14 Aug 2015 19:33:24 +0200 Subject: [PATCH] Further fixes for GCC 4.7 build --- src/common/thread/sdl_thread_wrapper.h | 14 +++++++++----- src/script/script.h | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/common/thread/sdl_thread_wrapper.h b/src/common/thread/sdl_thread_wrapper.h index e7a61b0e..7ff4dd0a 100644 --- a/src/common/thread/sdl_thread_wrapper.h +++ b/src/common/thread/sdl_thread_wrapper.h @@ -42,11 +42,7 @@ public: void Start() { - m_thread = SDL_CreateThread([](void* data) -> int { - ThreadFunctionPtr func = *(static_cast(data)); - func(); - return 0; - }, &m_threadFunction); + m_thread = SDL_CreateThread(&StartThreadWithThreadFunction, &m_threadFunction); } SDL_Thread* operator*() @@ -54,6 +50,14 @@ public: return m_thread; } +private: + static int StartThreadWithThreadFunction(void* data) + { + ThreadFunctionPtr func = *(static_cast(data)); + func(); + return 0; + } + private: ThreadFunctionPtr m_threadFunction; SDL_Thread* m_thread; diff --git a/src/script/script.h b/src/script/script.h index 51d3bd53..78d65cb5 100644 --- a/src/script/script.h +++ b/src/script/script.h @@ -28,6 +28,7 @@ #include "common/global.h" +#include class COldObject;