From 54d1197b1ad9df63bd3d85c44ecf06a63d812714 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Mon, 17 Aug 2020 10:20:37 +0000 Subject: [PATCH] added QSE_CPP_OVERRIDE --- qse/include/qse/Types.hpp | 3 +++ qse/include/qse/si/Thread.hpp | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/qse/include/qse/Types.hpp b/qse/include/qse/Types.hpp index 7645a3cc..d52f7003 100644 --- a/qse/include/qse/Types.hpp +++ b/qse/include/qse/Types.hpp @@ -44,6 +44,7 @@ #define QSE_CPP_THREXCEPT4(e1,e2,e3,e4) throw(e1,e2,e3,e4) #define QSE_CPP_THREXCEPT5(e1,e2,e3,e4,e5) throw(e1,e2,e3,e4,e5) #define QSE_CPP_EXPLICIT explicit + #define QSE_CPP_OVERRIDE override /// The QSE_CPP_ENABLE_CPP11_MOVE macro enables C++11 move semantics /// in various classes. @@ -69,6 +70,7 @@ #define QSE_CPP_THREXCEPT4(e1,e2,e3,e4) throw(e1,e2,e3,e4) #define QSE_CPP_THREXCEPT5(e1,e2,e3,e4,e5) throw(e1,e2,e3,e4,e5) #define QSE_CPP_EXPLICIT + #define QSE_CPP_OVERRIDE #define QSE_CPP_CALL_DESTRUCTOR(ptr, class_name) ((ptr)->~class_name()) #define QSE_CPP_CALL_PLACEMENT_DELETE1(ptr, arg1) (::operator delete((ptr), (arg1))) @@ -81,6 +83,7 @@ #define QSE_CPP_THREXCEPT4(e1,e2,e3,e4) #define QSE_CPP_THREXCEPT5(e1,e2,e3,e4,e5) #define QSE_CPP_EXPLICIT + #define QSE_CPP_OVERRIDE #if defined(__BORLANDC__) diff --git a/qse/include/qse/si/Thread.hpp b/qse/include/qse/si/Thread.hpp index 6b71a9dd..953164d1 100644 --- a/qse/include/qse/si/Thread.hpp +++ b/qse/include/qse/si/Thread.hpp @@ -118,7 +118,9 @@ public: typedef int (*ThreadRoutine) (Thread* thr); // execute the given function in a thread. - virtual int start (ThreadRoutine rtn, int flags = 0) QSE_CPP_NOEXCEPT; + // this is supposed to hide Thread::start(int flags). + // in this class, the start() method must be given the ThreadRoutine point. + virtual int start (ThreadRoutine rtn, int flags = 0) QSE_CPP_NOEXCEPT QSE_CPP_OVERRIDE; protected: ThreadRoutine __tmprtn;