Blob Blame History Raw
From b9fa4f6bb61ccd58c94a7c0a222fd91bea4b5341 Mon Sep 17 00:00:00 2001
From: Johann Friedrichs <johann.friedrichs@web.de>
Date: Mon, 8 Apr 2019 16:14:50 +0200
Subject: Replace auto_ptr with unique_ptr (only for c++11) (vdr-portal: kfb77)


diff --git a/epgsearch.c b/epgsearch.c
index 0d5ca6b..794b016 100644
--- a/epgsearch.c
+++ b/epgsearch.c
@@ -414,16 +414,26 @@ bool cPluginEpgsearch::Service(const char *Id, void *Data)
         if (Data == NULL)
             return true;
         Epgsearch_services_v1_0* serviceData = (Epgsearch_services_v1_0*) Data;
+#if __cplusplus < 201103L
         std::auto_ptr<cEpgsearchServiceHandler> autoHandler(new cEpgsearchServiceHandler);
         serviceData->handler = autoHandler;
+#else
+	 std::unique_ptr<cEpgsearchServiceHandler> autoHandler(new cEpgsearchServiceHandler);
+         serviceData->handler = std::move(autoHandler);
+#endif
         return true;
     }
     if (strcmp(Id, "Epgsearch-services-v1.1") == 0) {
         if (Data == NULL)
             return true;
         Epgsearch_services_v1_1* serviceData = (Epgsearch_services_v1_1*) Data;
+#if __cplusplus < 201103L
         std::auto_ptr<cEpgsearchServiceHandler> autoHandler(new cEpgsearchServiceHandler);
         serviceData->handler = autoHandler;
+#else
+        std::unique_ptr<cEpgsearchServiceHandler> autoHandler(new cEpgsearchServiceHandler);
+        serviceData->handler = std::move(autoHandler);
+#endif
         return true;
     }
     return false;
diff --git a/services.h b/services.h
index f6fedd8..05ceeeb 100644
--- a/services.h
+++ b/services.h
@@ -154,7 +154,11 @@ public:
 
 struct Epgsearch_services_v1_0 {
 // in/out
+#if __cplusplus < 201103L
     std::auto_ptr<cServiceHandler> handler;
+#else
+    std::unique_ptr<cServiceHandler> handler;
+#endif
 };
 
 // Data structures for service "Epgsearch-services-v1.1"
@@ -169,7 +173,11 @@ public:
 
 struct Epgsearch_services_v1_1 {
 // in/out
+#if __cplusplus < 201103L
     std::auto_ptr<cServiceHandler_v1_1> handler;
+#else
+    std::unique_ptr<cServiceHandler_v1_1> handler;
+#endif
 };
 
 // Data structures for service "Epgsearch-services-v1.2"
@@ -184,7 +192,11 @@ public:
 
 struct Epgsearch_services_v1_2 {
 // in/out
+#if __cplusplus < 201103L
     std::auto_ptr<cServiceHandler_v1_2> handler;
+#else
+    std::unique_ptr<cServiceHandler_v1_2> handler;
+#endif
 };
 
 #endif
-- 
cgit v0.10.2