summaryrefslogtreecommitdiff
path: root/autoptr.h
diff options
context:
space:
mode:
authorJasmin Jessich <jasmin@anw.at>2017-05-19 20:31:08 +0200
committerJasmin Jessich <jasmin@anw.at>2017-05-20 02:49:29 +0200
commiteba2ad612cc25fcfcd7347f360b5506ba8921835 (patch)
tree5cb0d596e1d7e448856e28921fe83daf70ea86be /autoptr.h
parent3aea661f98a0dbf87a4331640ad0408bdb8c4092 (diff)
downloadvdr-plugin-live-eba2ad612cc25fcfcd7347f360b5506ba8921835.tar.gz
vdr-plugin-live-eba2ad612cc25fcfcd7347f360b5506ba8921835.tar.bz2
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".
Diffstat (limited to 'autoptr.h')
-rw-r--r--autoptr.h14
1 files changed, 14 insertions, 0 deletions
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