diff options
author | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2020-05-11 10:26:05 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-11 10:26:05 -0700 |
commit | a196b9b7e924d33c465c3ab6a4f7654f36c33284 (patch) | |
tree | 8dbb2c927b98169d582b0e33ee95f9d3dfa5ea33 | |
parent | f49d7acdfbf2999a577dddb58235eaf9e71721cf (diff) | |
parent | c2d90c49f9b6a77f8920db580e79be25a4b922c8 (diff) | |
download | pugixml-a196b9b7e924d33c465c3ab6a4f7654f36c33284.zip pugixml-a196b9b7e924d33c465c3ab6a4f7654f36c33284.tar.gz pugixml-a196b9b7e924d33c465c3ab6a4f7654f36c33284.tar.bz2 |
Merge pull request #353 from jhasse/nullptr-in-header
Use nullptr in pugixml.hpp if available, see #91
-rw-r--r-- | src/pugixml.hpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/pugixml.hpp b/src/pugixml.hpp index f658109..dc26615 100644 --- a/src/pugixml.hpp +++ b/src/pugixml.hpp @@ -111,6 +111,15 @@ # endif #endif +// If C++ is 2011 or higher, use 'nullptr' +#ifndef PUGIXML_NULL +# if __cplusplus >= 201103 +# define PUGIXML_NULL nullptr +# else +# define PUGIXML_NULL 0 +# endif +#endif + // Character interface macros #ifdef PUGIXML_WCHAR_MODE # define PUGIXML_TEXT(t) L ## t @@ -661,15 +670,15 @@ namespace pugi #ifndef PUGIXML_NO_XPATH // Select single node by evaluating XPath query. Returns first node from the resulting node set. - xpath_node select_node(const char_t* query, xpath_variable_set* variables = 0) const; + xpath_node select_node(const char_t* query, xpath_variable_set* variables = PUGIXML_NULL) const; xpath_node select_node(const xpath_query& query) const; // Select node set by evaluating XPath query - xpath_node_set select_nodes(const char_t* query, xpath_variable_set* variables = 0) const; + xpath_node_set select_nodes(const char_t* query, xpath_variable_set* variables = PUGIXML_NULL) const; xpath_node_set select_nodes(const xpath_query& query) const; // (deprecated: use select_node instead) Select single node by evaluating XPath query. - PUGIXML_DEPRECATED xpath_node select_single_node(const char_t* query, xpath_variable_set* variables = 0) const; + PUGIXML_DEPRECATED xpath_node select_single_node(const char_t* query, xpath_variable_set* variables = PUGIXML_NULL) const; PUGIXML_DEPRECATED xpath_node select_single_node(const xpath_query& query) const; #endif @@ -1212,7 +1221,7 @@ namespace pugi public: // Construct a compiled object from XPath expression. // If PUGIXML_NO_EXCEPTIONS is not defined, throws xpath_exception on compilation errors. - explicit xpath_query(const char_t* query, xpath_variable_set* variables = 0); + explicit xpath_query(const char_t* query, xpath_variable_set* variables = PUGIXML_NULL); // Constructor xpath_query(); |