[nemiver] Don't define GDBMITuple methods inline



commit c7d07060907fbde36cfcc45291468c9b66f7898e
Author: Landry Breuil <landry fr homeunix org>
Date:   Mon Apr 13 13:51:54 2009 +0200

    Don't define GDBMITuple methods inline
    
    	* src/dbgengine/nmv-gdbmi-parser.h: Move the definition of
    	GDBMITuple from here ...
    	* src/dbgengine/nmv-gdbmi-parser.cc: ... to here.
    	We do this because otherwise gcc 3.3.5 won't compile this on
    	OpenBSD.
---
 src/dbgengine/nmv-gdbmi-parser.cc |   38 +++++++++++++++++++++++++++++++++++++
 src/dbgengine/nmv-gdbmi-parser.h  |   17 +++++++++------
 2 files changed, 48 insertions(+), 7 deletions(-)

diff --git a/src/dbgengine/nmv-gdbmi-parser.cc b/src/dbgengine/nmv-gdbmi-parser.cc
index 741051b..ff76e5f 100644
--- a/src/dbgengine/nmv-gdbmi-parser.cc
+++ b/src/dbgengine/nmv-gdbmi-parser.cc
@@ -116,6 +116,44 @@ using namespace nemiver::common;
 
 NEMIVER_BEGIN_NAMESPACE (nemiver)
 
+// *******************************
+// <Definitions of GDBMITuple>
+// *******************************
+// Okay, we put the definitions of the GDBMITuple here
+// (instead of having them in nmv-gdbmi-parser.h alongside the other GDBMI
+// types) because otherwise, it won't build on OpenBSD, as nemiver is being
+// built with gcc 3.3.5 on that system for now.
+// So please, do not change this unless you are *SURE* it won't break on
+// OpenBSD at least.
+
+const list<GDBMIResultSafePtr>&
+GDBMITuple::content () const
+{
+    return m_content;
+}
+
+void
+GDBMITuple::content (const list<GDBMIResultSafePtr> &a_in)
+{
+    m_content = a_in;
+}
+
+void
+GDBMITuple::append (const GDBMIResultSafePtr &a_result)
+{
+    m_content.push_back (a_result);
+}
+
+void
+GDBMITuple::clear ()
+{
+    m_content.clear ();
+}
+
+// *******************************
+// </Definitions of GDBMITuple>
+// *******************************
+
 // prefixes of command output records.
 const char* PREFIX_DONE = "^done";
 const char* PREFIX_RUNNING = "^running";
diff --git a/src/dbgengine/nmv-gdbmi-parser.h b/src/dbgengine/nmv-gdbmi-parser.h
index 202e86c..e04006d 100644
--- a/src/dbgengine/nmv-gdbmi-parser.h
+++ b/src/dbgengine/nmv-gdbmi-parser.h
@@ -40,6 +40,8 @@ typedef SafePtr<GDBMITuple, ObjectRef, ObjectUnref> GDBMITupleSafePtr ;
 typedef SafePtr<GDBMIValue, ObjectRef, ObjectUnref> GDBMIValueSafePtr;
 typedef SafePtr<GDBMIList, ObjectRef, ObjectUnref> GDBMIListSafePtr ;
 
+/// This type abstracts a GDB/MI TUPLE.
+/// TUPLE ==>   "{}" | "{" RESULT ( "," RESULT )* "}"
 class GDBMITuple : public Object {
     GDBMITuple (const GDBMITuple&) ;
     GDBMITuple& operator= (const GDBMITuple&) ;
@@ -48,15 +50,16 @@ class GDBMITuple : public Object {
 
 public:
 
+    // Please do not define the methods of this class inline here.
+    // Rather, define them in nmv-gdbmi-parser.cc, otherwise, this file
+    // will not compile on OpenBSD (gcc 3.3.5). Please read the comment before
+    // the definition of GDBMITuple methods in that file.
     GDBMITuple () {}
     virtual ~GDBMITuple () {}
-    const list<GDBMIResultSafePtr>& content () const {return m_content;}
-    void content (const list<GDBMIResultSafePtr> &a_in) {m_content = a_in;}
-    void append (const GDBMIResultSafePtr &a_result)
-    {
-        m_content.push_back (a_result);
-    }
-    void clear () {m_content.clear ();}
+    const list<GDBMIResultSafePtr>& content () const;
+    void content (const list<GDBMIResultSafePtr> &a_in);
+    void append (const GDBMIResultSafePtr &a_result);
+    void clear ();
 };//end class GDBMITuple
 
 /// A GDB/MI Value.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]