summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohann Friedrichs <johann.friedrichs@web.de>2019-04-08 16:14:50 +0200
committerJohann Friedrichs <johann.friedrichs@web.de>2019-04-08 16:14:50 +0200
commitb9fa4f6bb61ccd58c94a7c0a222fd91bea4b5341 (patch)
tree79c1a417fa621509db92205acd34fe50e9359686
parentacbe3cf6a3ca6a5287da7d732264a7bb52e03673 (diff)
downloadvdr-plugin-epgsearch-b9fa4f6bb61ccd58c94a7c0a222fd91bea4b5341.tar.gz
vdr-plugin-epgsearch-b9fa4f6bb61ccd58c94a7c0a222fd91bea4b5341.tar.bz2
Replace auto_ptr with unique_ptr (only for c++11) (vdr-portal: kfb77)
-rw-r--r--epgsearch.c10
-rw-r--r--services.h12
2 files changed, 22 insertions, 0 deletions
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