[Opalvoip-devel] override specifier
Brought to you by:
csoutheren,
rjongbloed
|
From: Ed <ed0...@gm...> - 2023-11-27 07:10:12
|
Hi,
in object.h the empty macro 'override' is defined for old c++ compilers.
Sadly, msvc does not set __cplusplus correctly. It's still at 199711L.
Microsoft suggests to check _MSC_VER.
diff --git a/include/ptlib/object.h b/include/ptlib/object.h
index eec78432c..1529e99b2 100644
--- a/include/ptlib/object.h
+++ b/include/ptlib/object.h
@@ -95,7 +95,10 @@ using namespace std; // Not a good practice (name space
polution), but will take
///////////////////////////////////////////////////////////////////////////////
// Deal with different C++ versions and std::auto_ptr deprecation
#if __cplusplus < 201103L
+
+#if !defined _MSC_VER || _MSC_VER < 1700 // override is fully supported
since Visual Studio 2012
#define override
+#endif
struct PNonCopyable
{
-- Ed
|