summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2011-02-04 22:53:22 -0500
committerJohn Wiegley <johnw@newartisans.com>2011-02-04 22:53:22 -0500
commit0f8e0251f412f82fe3217f3a301ba0f3574aea12 (patch)
treebc0791335400502c34e49c0310c0c8592fdbb9ee /src
parent2208ac1226bb3be82be550d465f08fc1dd7c1bae (diff)
downloadfork-ledger-0f8e0251f412f82fe3217f3a301ba0f3574aea12.tar.gz
fork-ledger-0f8e0251f412f82fe3217f3a301ba0f3574aea12.tar.bz2
fork-ledger-0f8e0251f412f82fe3217f3a301ba0f3574aea12.zip
Fixed a bug preventing g++ 4.6 from working
Diffstat (limited to 'src')
-rw-r--r--src/system.hh.in2
-rw-r--r--src/token.cc7
-rw-r--r--src/utils.h2
3 files changed, 9 insertions, 2 deletions
diff --git a/src/system.hh.in b/src/system.hh.in
index d5b14bdb..c1cc8e30 100644
--- a/src/system.hh.in
+++ b/src/system.hh.in
@@ -149,7 +149,7 @@ typedef std::ostream::pos_type ostream_pos_type;
#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/path.hpp>
-#if !(__cplusplus > 199711)
+#if !(defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__)
#include <boost/foreach.hpp>
#endif
#include <boost/function.hpp>
diff --git a/src/token.cc b/src/token.cc
index 64a5e9f9..7bfaf162 100644
--- a/src/token.cc
+++ b/src/token.cc
@@ -439,6 +439,13 @@ void expr_t::token_t::next(std::istream& in, const parse_flags_t& pflags,
unexpected(expecting);
}
} else {
+ if (! in.good()) {
+ in.clear();
+ in.seekg(0, std::ios::end);
+ if (in.fail())
+ throw_(parse_error, _("Failed to reset input stream"));
+ }
+
kind = VALUE;
value = temp;
length = static_cast<std::size_t>(in.tellg() - pos);
diff --git a/src/utils.h b/src/utils.h
index 44ee2c02..af75514c 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -523,7 +523,7 @@ inline void check_for_signal() {
*/
/*@{*/
-#if (__cplusplus > 199711)
+#if defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__
#define foreach(x, y) for (x : y)
#define unique_ptr std::unique_ptr
#else