From 085de1b56207e02c7e6fb020e062d9ae592ffbbd Mon Sep 17 00:00:00 2001 From: planetmaker Date: Sat, 18 Sep 2021 19:45:07 +0200 Subject: [PATCH] Fix: [linux] Silence warnings about deprecated use of std::auto_ptr. Use std::unique_ptr for GCC > 4.4 --- nel/include/nel/misc/types_nl.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/nel/include/nel/misc/types_nl.h b/nel/include/nel/misc/types_nl.h index a257eb2939..744e5d2e47 100644 --- a/nel/include/nel/misc/types_nl.h +++ b/nel/include/nel/misc/types_nl.h @@ -174,7 +174,7 @@ # define NL_COMP_GCC #endif -#if defined(_HAS_CPP0X) || defined(__GXX_EXPERIMENTAL_CXX0X__) || (defined(NL_COMP_VC_VERSION) && NL_COMP_VC_VERSION >= 110) +#if defined(_HAS_CPP0X) || defined(__GXX_EXPERIMENTAL_CXX0X__) || (defined(__GNUG__) && __cplusplus >= 201103L) || (defined(NL_COMP_VC_VERSION) && NL_COMP_VC_VERSION >= 110) # define NL_ISO_CPP0X_AVAILABLE #endif @@ -515,7 +515,12 @@ extern void operator delete[](void *p) throw(); # define CHashMap ::__gnu_cxx::hash_map # define CHashSet ::__gnu_cxx::hash_set # define CHashMultiMap ::__gnu_cxx::hash_multimap -# define CUniquePtr ::std::auto_ptr +// From GCC 4.4 onward std:unique_ptr should be available in std library. It's deprectated later on +# if GCC_VERSION > 40400 +# define CUniquePtr ::std::unique_ptr +# else +# define CUniquePtr ::std::auto_ptr +# endif # define CUniquePtrMove namespace __gnu_cxx {