* 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 "aterm.hh"
#include "util.hh" #include "util.hh"
#include <cstdlib>
namespace nix { namespace nix {

View file

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

View file

@ -2,6 +2,7 @@
#include "util.hh" #include "util.hh"
#include <cerrno> #include <cerrno>
#include <cstdlib>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.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 deleteLockFilePreClose(const Path & path, int fd);
void deleteLockFilePostClose(const Path & path); void deleteLockFilePostClose(const Path & path);
typedef enum LockType { ltRead, ltWrite, ltNone }; enum LockType { ltRead, ltWrite, ltNone };
bool lockFile(int fd, LockType lockType, bool wait); bool lockFile(int fd, LockType lockType, bool wait);

View file

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

View file

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

View file

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

View file

@ -83,7 +83,7 @@ Hash compressHash(const Hash & hash, unsigned int newSize);
HashType parseHashType(const string & s); HashType parseHashType(const string & s);
typedef union Ctx; union Ctx;
class HashSink : public Sink class HashSink : public Sink
{ {

View file

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

View file

@ -7,6 +7,7 @@
#include <iostream> #include <iostream>
#include <cerrno> #include <cerrno>
#include <cstdio> #include <cstdio>
#include <cstdlib>
#include <sstream> #include <sstream>
#include <cstring> #include <cstring>
@ -529,13 +530,14 @@ AutoDelete::AutoDelete(const string & p, bool recursive) : path(p)
AutoDelete::~AutoDelete() AutoDelete::~AutoDelete()
{ {
try { try {
if (del) if (del) {
if (recursive) if (recursive)
deletePath(path); deletePath(path);
else { else {
if (remove(path.c_str()) == -1) if (remove(path.c_str()) == -1)
throw SysError(format("cannot unlink `%1%'") % path); throw SysError(format("cannot unlink `%1%'") % path);
} }
}
} catch (...) { } catch (...) {
ignoreException(); ignoreException();
} }

View file

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