about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libexpr/expr-to-xml.cc2
-rw-r--r--src/libexpr/nixexpr.cc2
-rw-r--r--src/libstore/pathlocks.cc1
-rw-r--r--src/libstore/pathlocks.hh2
-rw-r--r--src/libstore/references.cc2
-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
-rw-r--r--src/nix-log2xml/log2xml.cc1
11 files changed, 18 insertions, 3 deletions
diff --git a/src/libexpr/expr-to-xml.cc b/src/libexpr/expr-to-xml.cc
index 6d27bcffb69c..947e62879f0c 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 1eeec2cf19f7..0f5ec030654f 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 9d582206dbb9..df1f0b1e3831 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 0ca1ce687849..8b4100028f0b 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 19cb288bdd6b..bfb4f8d0a3af 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 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();
     }
diff --git a/src/nix-log2xml/log2xml.cc b/src/nix-log2xml/log2xml.cc
index c30fa5b02667..9be3978a9274 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;