* GCC 4.3.0 (Fedora 9) compatibility fixes. Reported by Gour and

Armijn Hemel.
This commit is contained in:
Eelco Dolstra 2008-05-21 11:17:31 +00:00
parent 9819bb20da
commit bd955e15e1
11 changed files with 18 additions and 3 deletions

View file

@ -4,6 +4,8 @@
#include "aterm.hh"
#include "util.hh"
#include <cstdlib>
namespace nix {

View file

@ -6,6 +6,8 @@
#include "nixexpr-ast.hh"
#include "nixexpr-ast.cc"
#include <cstdlib>
namespace nix {

View file

@ -2,6 +2,7 @@
#include "util.hh"
#include <cerrno>
#include <cstdlib>
#include <sys/types.h>
#include <sys/stat.h>

View file

@ -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);

View file

@ -3,6 +3,8 @@
#include "util.hh"
#include <cerrno>
#include <cstring>
#include <cstdlib>
#include <map>
#include <sys/types.h>

View file

@ -1,5 +1,7 @@
#include "aterm.hh"
#include <cstring>
using std::string;

View file

@ -1,6 +1,7 @@
#include "config.h"
#include <iostream>
#include <cstring>
#ifdef HAVE_OPENSSL
#include <openssl/md5.h>

View file

@ -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
{

View file

@ -1,6 +1,8 @@
#include "serialise.hh"
#include "util.hh"
#include <cstring>
namespace nix {

View file

@ -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();
}

View file

@ -2,6 +2,7 @@
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
using namespace std;