summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-extended/qpid/qpid/QPID-4579-Fixes-building-Qpid-under-the-latest-GCC-4.patch
blob: 73bee5c98feac5505ca895104296c0eb24ed235c (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
From 9736799d05368da9641b2220aaa1cab850f562cb Mon Sep 17 00:00:00 2001
From: "Darryl L. Pierce" <mcpierce@apache.org>
Date: Tue, 12 Feb 2013 19:26:13 +0000
Subject: [PATCH] QPID-4579: Fixes building Qpid under the latest GCC (4.8.0).

commit 631f31a401f308e93303d5cc3a60f03f4c5eca34 from upstream
git://git.apache.org/qpid.git

Moves the definition of Functor and MemFuncRef out of Handler class
definition. Fixes the build failure in later versions of GCC.

Contributed by: Petr Machata <pmachata@redhat.com>
[MA: rebased]
Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>

git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1445322 13f79535-47bb-0310-9956-ffa450edef68
---
 src/qpid/framing/Handler.h | 43 ++++++++++++++++++++++++-------------------
 1 file changed, 24 insertions(+), 19 deletions(-)

diff --git a/src/qpid/framing/Handler.h b/src/qpid/framing/Handler.h
index fa8db36..e0c0e59 100644
--- a/src/qpid/framing/Handler.h
+++ b/src/qpid/framing/Handler.h
@@ -49,29 +49,12 @@ struct Handler {
      * Functor<F>(f) will copy f.
      * Functor<F&>(f) will only take a reference to x.
      */
-    template <class F> class Functor : public Handler<T> {
-      public:
-        Functor(F f, Handler<T>* next=0) : Handler<T>(next), functor(f) {}
-        void handle(T t) { functor(t); }
-      private:
-        F functor;
-    };
+    template <class F> class Functor;
 
     /** Adapt a member function of X as a Handler.
      * Only holds a reference to its target, not a copy.
      */
-    template <class X, void (X::*F)(T)>
-    class MemFunRef : public Handler<T> {
-      public:
-        MemFunRef(X& x, Handler<T>* next=0) : Handler(next), target(&x) {}
-        void handle(T t) { (target->*F)(t); }
-
-        /** Allow calling with -> syntax */
-        MemFunRef* operator->() { return this; }
-
-      private:
-        X* target;
-    };
+    template <class X, void (X::*F)(T)> class MemFunRef;
 
     /** Interface for a handler that implements a
      * pair of in/out handle operations.
@@ -94,7 +77,29 @@ struct Handler {
     };
 };
 
+template <class T>
+template <class F>
+class Handler<T>::Functor : public Handler<T> {
+  public:
+    Functor(F f, Handler<T>* next=0) : Handler<T>(next), functor(f) {}
+    void handle(T t) { functor(t); }
+  private:
+    F functor;
+};
+
+template <class T>
+template <class X, void (X::*F)(T)>
+class Handler<T>::MemFunRef : public Handler<T> {
+  public:
+    MemFunRef(X& x, Handler<T>* next=0) : Handler(next), target(&x) {}
+    void handle(T t) { (target->*F)(t); }
+
+    /** Allow calling with -> syntax */
+    MemFunRef* operator->() { return this; }
 
+  private:
+    X* target;
+};
 
 }}
 #endif  /*!QPID_FRAMING_HANDLER_H*/
-- 
1.8.3.2