From bd955e15e1aac8a1490a680b9f5cfcce29f2331a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 21 May 2008 11:17:31 +0000 Subject: [PATCH] * GCC 4.3.0 (Fedora 9) compatibility fixes. Reported by Gour and Armijn Hemel. --- src/libexpr/expr-to-xml.cc | 2 ++ src/libexpr/nixexpr.cc | 2 ++ src/libstore/pathlocks.cc | 1 + src/libstore/pathlocks.hh | 2 +- src/libstore/references.cc | 2 ++ src/libutil/aterm.cc | 2 ++ src/libutil/hash.cc | 1 + src/libutil/hash.hh | 2 +- src/libutil/serialise.cc | 2 ++ src/libutil/util.cc | 4 +++- src/nix-log2xml/log2xml.cc | 1 + 11 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/libexpr/expr-to-xml.cc b/src/libexpr/expr-to-xml.cc index 6d27bcffb..947e62879 100644 --- a/src/libexpr/expr-to-xml.cc +++ b/src/libexpr/expr-to-xml.cc @@ -4,6 +4,8 @@ #include "aterm.hh" #include "util.hh" +#include + namespace nix { diff --git a/src/libexpr/nixexpr.cc b/src/libexpr/nixexpr.cc index 1eeec2cf1..0f5ec0306 100644 --- a/src/libexpr/nixexpr.cc +++ b/src/libexpr/nixexpr.cc @@ -6,6 +6,8 @@ #include "nixexpr-ast.hh" #include "nixexpr-ast.cc" +#include + namespace nix { diff --git a/src/libstore/pathlocks.cc b/src/libstore/pathlocks.cc index 9d582206d..df1f0b1e3 100644 --- a/src/libstore/pathlocks.cc +++ b/src/libstore/pathlocks.cc @@ -2,6 +2,7 @@ #include "util.hh" #include +#include #include #include diff --git a/src/libstore/pathlocks.hh b/src/libstore/pathlocks.hh index 0ca1ce687..8b4100028 100644 --- a/src/libstore/pathlocks.hh +++ b/src/libstore/pathlocks.hh @@ -17,7 +17,7 @@ int openLockFile(const Path & path, bool create); void deleteLockFilePreClose(const Path & path, int fd); void deleteLockFilePostClose(const Path & path); -typedef enum LockType { ltRead, ltWrite, ltNone }; +enum LockType { ltRead, ltWrite, ltNone }; bool lockFile(int fd, LockType lockType, bool wait); diff --git a/src/libstore/references.cc b/src/libstore/references.cc index 19cb288bd..bfb4f8d0a 100644 --- a/src/libstore/references.cc +++ b/src/libstore/references.cc @@ -3,6 +3,8 @@ #include "util.hh" #include +#include +#include #include #include diff --git a/src/libutil/aterm.cc b/src/libutil/aterm.cc index 90a8e212e..25d704785 100644 --- a/src/libutil/aterm.cc +++ b/src/libutil/aterm.cc @@ -1,5 +1,7 @@ #include "aterm.hh" +#include + using std::string; diff --git a/src/libutil/hash.cc b/src/libutil/hash.cc index 3d20d2d50..70604a50a 100644 --- a/src/libutil/hash.cc +++ b/src/libutil/hash.cc @@ -1,6 +1,7 @@ #include "config.h" #include +#include #ifdef HAVE_OPENSSL #include diff --git a/src/libutil/hash.hh b/src/libutil/hash.hh index 85eb3c1b4..c3932b11b 100644 --- a/src/libutil/hash.hh +++ b/src/libutil/hash.hh @@ -83,7 +83,7 @@ Hash compressHash(const Hash & hash, unsigned int newSize); HashType parseHashType(const string & s); -typedef union Ctx; +union Ctx; class HashSink : public Sink { diff --git a/src/libutil/serialise.cc b/src/libutil/serialise.cc index c0e1c17af..c3fd4dd10 100644 --- a/src/libutil/serialise.cc +++ b/src/libutil/serialise.cc @@ -1,6 +1,8 @@ #include "serialise.hh" #include "util.hh" +#include + namespace nix { diff --git a/src/libutil/util.cc b/src/libutil/util.cc index 822c87a05..f978856a9 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -529,13 +530,14 @@ AutoDelete::AutoDelete(const string & p, bool recursive) : path(p) AutoDelete::~AutoDelete() { try { - if (del) + if (del) { if (recursive) deletePath(path); else { if (remove(path.c_str()) == -1) throw SysError(format("cannot unlink `%1%'") % path); } + } } catch (...) { ignoreException(); } diff --git a/src/nix-log2xml/log2xml.cc b/src/nix-log2xml/log2xml.cc index c30fa5b02..9be3978a9 100644 --- a/src/nix-log2xml/log2xml.cc +++ b/src/nix-log2xml/log2xml.cc @@ -2,6 +2,7 @@ #include #include #include +#include using namespace std;