summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2008-05-21 11:17:31 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2008-05-21 11:17:31 +0000
commitbd955e15e1aac8a1490a680b9f5cfcce29f2331a (patch)
treef56e21d3608bb14ae3ca89e2ddc6c7c887bfbd85 /src
parent9819bb20da130509ab62f303267331c2403b043c (diff)
downloadguix-bd955e15e1aac8a1490a680b9f5cfcce29f2331a.tar.gz
* 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.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 6d27bcffb6..947e62879f 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 1eeec2cf19..0f5ec03065 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 9d582206db..df1f0b1e38 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 0ca1ce6878..8b4100028f 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 19cb288bdd..bfb4f8d0a3 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 90a8e212ef..25d7047857 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 3d20d2d50d..70604a50a3 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 85eb3c1b4d..c3932b11b1 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 c0e1c17af0..c3fd4dd10c 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 822c87a050..f978856a96 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 c30fa5b026..9be3978a92 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;