summaryrefslogtreecommitdiffstats
path: root/meta-openembedded/meta-oe/recipes-devtools/nodejs/nodejs/0004-Make-compatibility-with-gcc-4.8.patch
blob: 925c085e9b284217dc85fe446b57d5996d0e6042 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
Implement function as wrapper for std::make_unique
method to be compatible with gcc < 4.9 .
"error::make_unique is not a member of 'std'"

Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>

diff -Naur node-v10.15.1/src/cares_wrap.cc node-v10.15.1/src/cares_wrap.cc
--- node-v10.15.1/src/cares_wrap.cc	2019-01-29 08:20:50.000000000 +0100
+++ node-v10.15.1/src/cares_wrap.cc	2019-02-21 16:22:25.489131665 +0100
@@ -52,6 +52,16 @@
 # define AI_V4MAPPED 0
 #endif
 
+#ifndef __cpp_lib_make_unique
+namespace std {
+  /// make_unique implementation
+  template<typename T, typename... Args>
+  std::unique_ptr<T> make_unique(Args&&... args) {
+    return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
+  }
+}
+#endif
+
 namespace node {
 namespace cares_wrap {
 
diff -Naur node-v10.15.1/src/inspector_agent.cc node-v10.15.1/src/inspector_agent.cc
--- node-v10.15.1/src/inspector_agent.cc	2019-01-29 08:20:50.000000000 +0100
+++ node-v10.15.1/src/inspector_agent.cc	2019-02-21 16:22:09.000185992 +0100
@@ -24,6 +24,16 @@
 #include <pthread.h>
 #endif  // __POSIX__
 
+#ifndef __cpp_lib_make_unique
+namespace std {
+  /// make_unique implementation
+  template<typename T, typename... Args>
+  std::unique_ptr<T> make_unique(Args&&... args) {
+    return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
+  }
+}
+#endif
+
 namespace node {
 namespace inspector {
 namespace {

diff --git a/src/inspector/main_thread_interface.cc b/src/inspector/main_thread_interface.cc
index e374c0fd70..05d7d8c60f 100644
--- a/src/inspector/main_thread_interface.cc
+++ b/src/inspector/main_thread_interface.cc
@@ -6,6 +6,16 @@
 #include <functional>
 #include <unicode/unistr.h>

+#ifndef __cpp_lib_make_unique
+namespace std {
+  /// make_unique implementation
+  template<typename T, typename... Args>
+  std::unique_ptr<T> make_unique(Args&&... args) {
+    return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
+  }
+}
+#endif
+
 namespace node {
 namespace inspector {
 namespace {
OpenPOWER on IntegriCloud