diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-10-01 12:53:07 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-10-01 12:58:04 +0100 |
| commit | 7fa910cb68b6c5bc8a6dcc5c71425a5534a76eb2 (patch) | |
| tree | fde62083998b1c410fa240515d46854fd8937d4b | |
| parent | 16a5e08b5a4947c34eac5335c016a8c7bafa56c6 (diff) | |
Fix build on Debian unstable.
| -rw-r--r-- | cscript | 2 | ||||
| -rw-r--r-- | src/cxml.cc | 31 | ||||
| -rw-r--r-- | wscript | 1 |
3 files changed, 20 insertions, 14 deletions
@@ -8,6 +8,8 @@ def build(target, options): # Centos builds using static boost, which means tests don't # build as test/tests.cc defines BOOST_TEST_DYN_LINK cmd += ' --disable-tests' + if target.distro == 'debian' and target.version == 'unstable': + target.append_with_space('CXXFLAGS', '-std=c++11') elif target.platform == 'windows': cmd += ' --target-windows' target.command(cmd) diff --git a/src/cxml.cc b/src/cxml.cc index a9ab769..fb8ca2d 100644 --- a/src/cxml.cc +++ b/src/cxml.cc @@ -24,8 +24,12 @@ #include <libxml++/libxml++.h> #include "cxml.h" -using namespace std; -using namespace boost; +using std::string; +using std::stringstream; +using std::istream; +using std::list; +using boost::shared_ptr; +using boost::optional; cxml::Node::Node () : _node (0) @@ -55,7 +59,7 @@ cxml::Node::node_child (string name) const } else if (n.empty ()) { throw cxml::Error ("missing XML tag " + name + " in " + _node->get_name()); } - + return n.front (); } @@ -68,7 +72,7 @@ cxml::Node::optional_node_child (string name) const } else if (n.empty ()) { return shared_ptr<cxml::Node> (); } - + return n.front (); } @@ -80,14 +84,14 @@ cxml::Node::node_children (string name) const */ xmlpp::Node::NodeList c = _node->get_children (); - + list<shared_ptr<cxml::Node> > n; for (xmlpp::Node::NodeList::iterator i = c.begin (); i != c.end(); ++i) { if ((*i)->get_name() == name) { n.push_back (shared_ptr<Node> (new Node (*i))); } } - + _taken.push_back (name); return n; } @@ -127,7 +131,7 @@ cxml::Node::optional_bool_child (string c) const if (!s) { return optional<bool> (); } - + return (s.get() == "1" || s.get() == "yes"); } @@ -144,7 +148,7 @@ cxml::Node::string_attribute (string name) const if (!e) { throw cxml::Error ("missing attribute " + name); } - + xmlpp::Attribute* a = e->get_attribute (name); if (!a) { throw cxml::Error ("missing attribute " + name); @@ -160,7 +164,7 @@ cxml::Node::optional_string_attribute (string name) const if (!e) { return optional<string> (); } - + xmlpp::Attribute* a = e->get_attribute (name); if (!a) { return optional<string> (); @@ -202,7 +206,7 @@ string cxml::Node::content () const { string content; - + xmlpp::Node::NodeList c = _node->get_children (); for (xmlpp::Node::NodeList::const_iterator i = c.begin(); i != c.end(); ++i) { xmlpp::ContentNode const * v = dynamic_cast<xmlpp::ContentNode const *> (*i); @@ -250,12 +254,12 @@ cxml::Document::~Document () } void -cxml::Document::read_file (filesystem::path file) +cxml::Document::read_file (boost::filesystem::path file) { - if (!filesystem::exists (file)) { + if (!boost::filesystem::exists (file)) { throw cxml::Error ("XML file " + file.string() + " does not exist"); } - + _parser->parse_file (file.string ()); take_root_node (); } @@ -289,4 +293,3 @@ cxml::Document::take_root_node () _root_name = _node->get_name (); } } - @@ -11,6 +11,7 @@ def options(opt): def configure(conf): conf.load('compiler_cxx') conf.env.append_value('CXXFLAGS', ['-Wall', '-Wextra', '-O2']) + print conf.env['CXXFLAGS'] conf.env.TARGET_WINDOWS = conf.options.target_windows conf.env.STATIC = conf.options.static |
