diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2008-05-21 11:17:31 +0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2008-05-21 11:17:31 +0000 |
commit | bd955e15e1aac8a1490a680b9f5cfcce29f2331a (patch) | |
tree | f56e21d3608bb14ae3ca89e2ddc6c7c887bfbd85 /src | |
parent | 9819bb20da130509ab62f303267331c2403b043c (diff) |
* GCC 4.3.0 (Fedora 9) compatibility fixes. Reported by Gour and
Armijn Hemel.
Diffstat (limited to 'src')
-rw-r--r-- | src/libexpr/expr-to-xml.cc | 2 | ||||
-rw-r--r-- | src/libexpr/nixexpr.cc | 2 | ||||
-rw-r--r-- | src/libstore/pathlocks.cc | 1 | ||||
-rw-r--r-- | src/libstore/pathlocks.hh | 2 | ||||
-rw-r--r-- | src/libstore/references.cc | 2 | ||||
-rw-r--r-- | src/libutil/aterm.cc | 2 | ||||
-rw-r--r-- | src/libutil/hash.cc | 1 | ||||
-rw-r--r-- | src/libutil/hash.hh | 2 | ||||
-rw-r--r-- | src/libutil/serialise.cc | 2 | ||||
-rw-r--r-- | src/libutil/util.cc | 4 | ||||
-rw-r--r-- | 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 <cstdlib> + 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 <cstdlib> + 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 <cerrno> +#include <cstdlib> #include <sys/types.h> #include <sys/stat.h> 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 <cerrno> +#include <cstring> +#include <cstdlib> #include <map> #include <sys/types.h> 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 <cstring> + 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 <iostream> +#include <cstring> #ifdef HAVE_OPENSSL #include <openssl/md5.h> 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 <cstring> + 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 <iostream> #include <cerrno> #include <cstdio> +#include <cstdlib> #include <sstream> #include <cstring> @@ -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 <iostream> #include <cstdio> #include <string> +#include <cstring> using namespace std; |