C++: Declare namespace in enums.hpp so it can be used independently.

This commit is contained in:
Martin Ling 2015-10-25 01:57:26 +00:00 committed by Daniel Elstner
parent e5c22906e8
commit ace872d529
3 changed files with 6 additions and 4 deletions

View 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)

View File

@ -986,8 +986,8 @@ private:
const string _name;
};
#include <libsigrokcxx/enums.hpp>
}
#include <libsigrokcxx/enums.hpp>
#endif

View File

@ -217,6 +217,4 @@ typedef std::map<const sigrok::ConfigKey *, Glib::VariantBase>
%include "swig/enums.i"
namespace sigrok {
%include <libsigrokcxx/enums.hpp>
}