Skip to content

Commit

Permalink
Merge pull request zeux#566 from ArchXUser/master
Browse files Browse the repository at this point in the history
Fix compilation errors on old GCC (2.95.3, 3.3.5)
  • Loading branch information
zeux authored May 11, 2023
2 parents 80a531e + 1e96363 commit f75dc6d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/pugixml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ using std::memmove;
using std::memset;
#endif

// Old versions of GCC do not define ::malloc and ::free depending on header include order
#if defined(__GNUC__) && (__GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4))
using std::malloc;
using std::free;
#endif

// Some MinGW/GCC versions have headers that erroneously omit LLONG_MIN/LLONG_MAX/ULLONG_MAX definitions from limits.h in some configurations
#if defined(PUGIXML_HAS_LONG_LONG) && defined(__GNUC__) && !defined(LLONG_MAX) && !defined(LLONG_MIN) && !defined(ULLONG_MAX)
# define LLONG_MIN (-LLONG_MAX - 1LL)
Expand Down Expand Up @@ -9950,7 +9956,8 @@ PUGI_IMPL_NS_BEGIN

xpath_node* last = ns.begin() + first;

xpath_context c(xpath_node(), 1, size);
xpath_node cn;
xpath_context c(cn, 1, size);

double er = expr->eval_number(c, stack);

Expand Down

0 comments on commit f75dc6d

Please sign in to comment.