]> sigrok.org Git - libsigrok.git/commitdiff
C++: Declare namespace in enums.hpp so it can be used independently.
authorMartin Ling <redacted>
Sun, 25 Oct 2015 01:57:26 +0000 (01:57 +0000)
committerDaniel Elstner <redacted>
Mon, 26 Oct 2015 06:17:01 +0000 (07:17 +0100)
bindings/cxx/enums.py
bindings/cxx/include/libsigrokcxx/libsigrokcxx.hpp
bindings/swig/classes.i

index 4e6be7ba2ae6d1a0d3f87a8a26c2150a6ca047ae..3ce73bc43f4eaab3fcc9706b70306870e89544ed 100644 (file)
@@ -75,6 +75,8 @@ swig = open(os.path.join(outdirname, 'swig/enums.i'), 'w')
 for file in (header, code):
     print("/* Generated file - edit enums.py instead! */", file=file)
 
+print("namespace sigrok {", file=header)
+
 # Template for beginning of class declaration and public members.
 header_public_template = """
 /** {brief} */
@@ -176,3 +178,5 @@ for enum, (classname, classbrief) in classes.items():
     filename = os.path.join(dirname, "%s_methods.i" % classname)
     if os.path.exists(filename):
         print(str.join('', open(filename).readlines()), file=swig)
+
+print("}", file=header)
index 620e45ebbc361bcc5407e27727f7897e9110b38c..48111b876a3237d0811b46d2fc862717c10148c3 100644 (file)
@@ -986,8 +986,8 @@ private:
        const string _name;
 };
 
-#include <libsigrokcxx/enums.hpp>
-
 }
 
+#include <libsigrokcxx/enums.hpp>
+
 #endif
index b87bbe1b06a33c3566c19e62a188fcb45078536c..523995dad9e19882b354d2891a8de7577ffe8716 100644 (file)
@@ -217,6 +217,4 @@ typedef std::map<const sigrok::ConfigKey *, Glib::VariantBase>
 
 %include "swig/enums.i"
 
-namespace sigrok {
 %include <libsigrokcxx/enums.hpp>
-}