From 13adc40187c21ef1dbba0b46cc865ebdfa2ab4ea Mon Sep 17 00:00:00 2001 From: Arnaud Gelas Date: Sat, 30 Apr 2011 08:37:38 -0400 Subject: fix compilation error on Mac 10.5 std::vector<>::data() does not exist --- src/subprocess.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/subprocess.cc b/src/subprocess.cc index cef0ad3..a4957ad 100644 --- a/src/subprocess.cc +++ b/src/subprocess.cc @@ -154,7 +154,7 @@ void SubprocessSet::DoWork() { } } - int ret = poll(fds.data(), fds.size(), -1); + int ret = poll(&fds.front(), fds.size(), -1); if (ret == -1) { if (errno != EINTR) perror("ninja: poll"); -- cgit v0.12 From d9c196c1ad2b008b8f6628ace0f9f9273a2b5d26 Mon Sep 17 00:00:00 2001 From: Arnaud Gelas Date: Sat, 30 Apr 2011 08:39:48 -0400 Subject: fix warnings on Mac 10.5 structures had virtual functions but not virtual destructors --- src/eval_env.h | 2 ++ src/ninja.h | 3 +++ src/parsers.h | 1 + 3 files changed, 6 insertions(+) diff --git a/src/eval_env.h b/src/eval_env.h index b1b63ca..37f7b07 100644 --- a/src/eval_env.h +++ b/src/eval_env.h @@ -22,6 +22,7 @@ using namespace std; /// An interface for a scope for variable (e.g. "$foo") lookups. struct Env { + virtual ~Env() {} virtual string LookupVariable(const string& var) = 0; }; @@ -29,6 +30,7 @@ struct Env { /// as well as a pointer to a parent scope. struct BindingEnv : public Env { BindingEnv() : parent_(NULL) {} + virtual ~BindingEnv() {} virtual string LookupVariable(const string& var); void AddBinding(const string& key, const string& val); diff --git a/src/ninja.h b/src/ninja.h index 5311324..1ff4e32 100644 --- a/src/ninja.h +++ b/src/ninja.h @@ -40,6 +40,8 @@ int ReadFile(const string& path, string* contents, string* err); /// Abstract so it can be mocked out for tests. The real implementation /// is RealDiskInterface. struct DiskInterface { + virtual ~DiskInterface() {} + /// stat() a file, returning the mtime, or 0 if missing and -1 on /// other errors. virtual int Stat(const string& path) = 0; @@ -55,6 +57,7 @@ struct DiskInterface { /// Implementation of DiskInterface that actually hits the disk. struct RealDiskInterface : public DiskInterface { + virtual ~RealDiskInterface() {} virtual int Stat(const string& path); virtual bool MakeDir(const string& path); virtual string ReadFile(const string& path, string* err); diff --git a/src/parsers.h b/src/parsers.h index 31fe8a7..58d2bd7 100644 --- a/src/parsers.h +++ b/src/parsers.h @@ -102,6 +102,7 @@ struct State; /// Parses .ninja files. struct ManifestParser { struct FileReader { + virtual ~FileReader() {} virtual bool ReadFile(const string& path, string* content, string* err) = 0; }; -- cgit v0.12