From eba2ad612cc25fcfcd7347f360b5506ba8921835 Mon Sep 17 00:00:00 2001 From: Jasmin Jessich Date: Fri, 19 May 2017 20:31:08 +0200 Subject: gcc-6 fixes - New file autoptr.h to switch between "std::unique_ptr" and "std::auto_ptr" depending on the GCC version, by new macro AUTO_PTR. - Removed some "using namespace std" and add some "#define __STL_CONFIG_H" before including header files. This will not define "swap" in vdr/tools.h. - Remove also "using namespace std::tr1". --- autoptr.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 autoptr.h (limited to 'autoptr.h') diff --git a/autoptr.h b/autoptr.h new file mode 100644 index 0000000..3349367 --- /dev/null +++ b/autoptr.h @@ -0,0 +1,14 @@ +#ifndef VDR_LIVE_AUTOPTR_H +#define VDR_LIVE_AUTOPTR_H + +#define GCC_VERSION (__GNUC__ * 10000 \ + + __GNUC_MINOR__ * 100 \ + + __GNUC_PATCHLEVEL__) + +#if GCC_VERSION > 50000 +# define AUTO_PTR std::unique_ptr +#else +# define AUTO_PTR std::auto_ptr +#endif + +#endif // VDR_LIVE_AUTOPTR_H -- cgit v1.2.3