about summary refs log tree commit diff
path: root/src/libutil
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2008-05-21T11·17+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2008-05-21T11·17+0000
commitbd955e15e1aac8a1490a680b9f5cfcce29f2331a (patch)
treef56e21d3608bb14ae3ca89e2ddc6c7c887bfbd85 /src/libutil
parent9819bb20da130509ab62f303267331c2403b043c (diff)
* GCC 4.3.0 (Fedora 9) compatibility fixes. Reported by Gour and
  Armijn Hemel.

Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/aterm.cc2
-rw-r--r--src/libutil/hash.cc1
-rw-r--r--src/libutil/hash.hh2
-rw-r--r--src/libutil/serialise.cc2
-rw-r--r--src/libutil/util.cc4
5 files changed, 9 insertions, 2 deletions
diff --git a/src/libutil/aterm.cc b/src/libutil/aterm.cc
index 90a8e212ef4d..25d70478573d 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 3d20d2d50d50..70604a50a342 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 85eb3c1b4d7e..c3932b11b187 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 c0e1c17af066..c3fd4dd10cc8 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 822c87a05009..f978856a96cc 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();
     }