diff options
Diffstat (limited to 'src/libutil')
-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 |
5 files changed, 9 insertions, 2 deletions
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(); } |