From 9f8e6c06347d45a1a208651a81ca10445062af06 Mon Sep 17 00:00:00 2001 From: Erik Hofman Date: Thu, 23 Jan 2020 10:38:52 +0100 Subject: [PATCH] Make backwards compatible stubs so only a recompile without any modification is required. --- simgear/threads/CMakeLists.txt | 1 + simgear/threads/SGGuard.hxx | 5 +++++ simgear/threads/SGThread.hxx | 5 +++++ 3 files changed, 11 insertions(+) create mode 100644 simgear/threads/SGGuard.hxx diff --git a/simgear/threads/CMakeLists.txt b/simgear/threads/CMakeLists.txt index 54ec3a7c..5258be8f 100644 --- a/simgear/threads/CMakeLists.txt +++ b/simgear/threads/CMakeLists.txt @@ -1,6 +1,7 @@ include (SimGearComponent) set(HEADERS + SGGuard.hxx SGQueue.hxx SGThread.hxx) diff --git a/simgear/threads/SGGuard.hxx b/simgear/threads/SGGuard.hxx new file mode 100644 index 00000000..1dc4bd2d --- /dev/null +++ b/simgear/threads/SGGuard.hxx @@ -0,0 +1,5 @@ +#pragma once +#pragma message(": warning use std::lock_guard and std::mutex.") + +// backwards compatibility, just needs a recompile +#define SGGuard std::lock_guard diff --git a/simgear/threads/SGThread.hxx b/simgear/threads/SGThread.hxx index ea1fa746..ba9f52d2 100644 --- a/simgear/threads/SGThread.hxx +++ b/simgear/threads/SGThread.hxx @@ -29,6 +29,11 @@ #include #include + +// backwards compatibility, just needs a recompile +#define SGMutex std::mutex + + /** * Encapsulate generic threading methods. * Users derive a class from SGThread and implement the run() member function.