C++: Declare namespace in enums.hpp so it can be used independently.
This commit is contained in:
parent
e5c22906e8
commit
ace872d529
|
@ -75,6 +75,8 @@ swig = open(os.path.join(outdirname, 'swig/enums.i'), 'w')
|
||||||
for file in (header, code):
|
for file in (header, code):
|
||||||
print("/* Generated file - edit enums.py instead! */", file=file)
|
print("/* Generated file - edit enums.py instead! */", file=file)
|
||||||
|
|
||||||
|
print("namespace sigrok {", file=header)
|
||||||
|
|
||||||
# Template for beginning of class declaration and public members.
|
# Template for beginning of class declaration and public members.
|
||||||
header_public_template = """
|
header_public_template = """
|
||||||
/** {brief} */
|
/** {brief} */
|
||||||
|
@ -176,3 +178,5 @@ for enum, (classname, classbrief) in classes.items():
|
||||||
filename = os.path.join(dirname, "%s_methods.i" % classname)
|
filename = os.path.join(dirname, "%s_methods.i" % classname)
|
||||||
if os.path.exists(filename):
|
if os.path.exists(filename):
|
||||||
print(str.join('', open(filename).readlines()), file=swig)
|
print(str.join('', open(filename).readlines()), file=swig)
|
||||||
|
|
||||||
|
print("}", file=header)
|
||||||
|
|
|
@ -986,8 +986,8 @@ private:
|
||||||
const string _name;
|
const string _name;
|
||||||
};
|
};
|
||||||
|
|
||||||
#include <libsigrokcxx/enums.hpp>
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include <libsigrokcxx/enums.hpp>
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -217,6 +217,4 @@ typedef std::map<const sigrok::ConfigKey *, Glib::VariantBase>
|
||||||
|
|
||||||
%include "swig/enums.i"
|
%include "swig/enums.i"
|
||||||
|
|
||||||
namespace sigrok {
|
|
||||||
%include <libsigrokcxx/enums.hpp>
|
%include <libsigrokcxx/enums.hpp>
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue