aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-core/iotivity/files/0189-resource-Include-functional-header-for-g-7.1.0.patch
blob: 2e40f97d104187a99dd76edc463d990e06041a42 (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
From fd9c363689646784303197da5a21d6693cc6cbc9 Mon Sep 17 00:00:00 2001
From: Philippe Coval <philippe.coval@osg.samsung.com>
Date: Wed, 28 Jun 2017 04:54:05 +0200
Subject: [PATCH 189/189] resource: Include functional header for g++-7.1.0

It was tested on yocto poky master on iotivity-1.2.1 (and later):

  resource/include/OCUtilities.h: \
  In function 'OCStackResult OC::nil_guard(PtrT&&, FnT&&, ParamTs&& ...)':
  resource/include/OCUtilities.h:85:21: \
  error: 'bind' is not a member of 'std'
  return std::bind(fn, p, std::ref(params)...)();

  resource/include/OCApi.h: At global scope:
  resource/include/OCApi.h:362:18: \
  error: 'function' in namespace 'std' does not name a template type
  typedef std::function<void(std::shared_ptr<OCResource>)> FindCallback;

Change-Id: Ie1cab497c33fde394f77490a1d636eb36a563396
Origin: https://gerrit.iotivity.org/gerrit/#/c/21069/
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21067
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
(cherry picked from commit 26c2798188497da22e0a70efebc47991dd755db2)
Reviewed-on: https://gerrit.iotivity.org/gerrit/21069
Reviewed-by: Sudarsana Babu Nagineni <sudarsana.nagineni@intel.com>
Reviewed-by: Mats Wichmann <mats@linux.com>
---
 resource/include/OCApi.h       | 2 --
 resource/include/OCUtilities.h | 1 +
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/resource/include/OCApi.h b/resource/include/OCApi.h
index ff2d212..47981d5 100644
--- a/resource/include/OCApi.h
+++ b/resource/include/OCApi.h
@@ -27,9 +27,7 @@
 #include <map>
 #include <memory>
 #include <iterator>
-#if defined(_MSC_VER)
 #include <functional>
-#endif
 
 #include "octypes.h"
 #include "OCHeaderOption.h"
diff --git a/resource/include/OCUtilities.h b/resource/include/OCUtilities.h
index 85039d0..f1c9304 100644
--- a/resource/include/OCUtilities.h
+++ b/resource/include/OCUtilities.h
@@ -26,6 +26,7 @@
 #include <memory>
 #include <utility>
 #include <exception>
+#include <functional>
 
 #include <OCException.h>
 #include <StringConstants.h>
-- 
2.7.4