blob: 2b325b675fcd84ab9ef23b79f98dfc0c956585b1 (
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
|
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>
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-02-17 09:40:36.040538319 +0100
+++ node-v10.15.1/src/cares_wrap.cc 2019-02-17 09:39:57.883668702 +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 {
|