From 1c7669671c46e463251589fad07aa470b27f80e8 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 10 Feb 2005 00:01:40 +0000 Subject: Changes to support building with gcc 2.95. --- textual.cc | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'textual.cc') diff --git a/textual.cc b/textual.cc index aabdbd3b..1982d29d 100644 --- a/textual.cc +++ b/textual.cc @@ -1,3 +1,7 @@ +#if defined(__GNUG__) && __GNUG__ < 3 +#define _XOPEN_SOURCE +#endif + #include "journal.h" #include "textual.h" #include "datetime.h" @@ -18,6 +22,11 @@ #include #include #include +#include + +#if defined(__GNUG__) && __GNUG__ < 3 +extern "C" char *realpath(const char *, char resolved_path[]); +#endif #define TIMELOG_SUPPORT 1 @@ -310,7 +319,7 @@ unsigned int textual_parser_t::parse(std::istream& in, while (in.good() && ! in.eof()) { try { - std::istream::pos_type beg_pos = in.tellg(); + istream_pos_type beg_pos = in.tellg(); in.getline(line, MAX_LINE); if (in.eof()) @@ -609,11 +618,11 @@ void write_textual_journal(journal_t& journal, std::string path, char buf2[PATH_MAX]; #ifdef HAVE_REALPATH - realpath(path.c_str(), buf1); + ::realpath(path.c_str(), buf1); for (strings_list::iterator i = journal.sources.begin(); i != journal.sources.end(); i++) { - realpath((*i).c_str(), buf2); + ::realpath((*i).c_str(), buf2); if (std::strcmp(buf1, buf2) == 0) { found = *i; break; @@ -640,8 +649,8 @@ void write_textual_journal(journal_t& journal, std::string path, auto_entries_list::iterator al = journal.auto_entries.begin(); period_entries_list::iterator pl = journal.period_entries.begin(); - std::istream::pos_type pos = 0; - std::istream::pos_type jump_to; + istream_pos_type pos = 0; + istream_pos_type jump_to; format_t hdr_fmt(config.write_hdr_format); -- cgit v1.2.3