summaryrefslogtreecommitdiffstats
path: root/src/test.cc
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2014-09-18 23:08:25 (GMT)
committerNico Weber <thakis@chromium.org>2014-09-18 23:09:20 (GMT)
commitac047b1f7efe3e90c2759864b57fd7c0d9404313 (patch)
tree22393d34d3ae63cf375841e127a02b8d89cdf65d /src/test.cc
parentff2739b118ca8a3c2e0f2709a2852acced0d8407 (diff)
downloadNinja-ac047b1f7efe3e90c2759864b57fd7c0d9404313.zip
Ninja-ac047b1f7efe3e90c2759864b57fd7c0d9404313.tar.gz
Ninja-ac047b1f7efe3e90c2759864b57fd7c0d9404313.tar.bz2
Fix building tests on Windows again.
Turns out gtest was pulling in sys/stat.h, and we were using stat() through that in tests. This doesn't work with old MSVCs, so we should probably replace that with RealDiskInterface in a follow-up.
Diffstat (limited to 'src/test.cc')
-rw-r--r--src/test.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/test.cc b/src/test.cc
index ed2b910..560ef3a 100644
--- a/src/test.cc
+++ b/src/test.cc
@@ -12,22 +12,25 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+#ifdef _WIN32
+#include <direct.h> // Has to be before util.h is included.
+#endif
+
#include "test.h"
#include <algorithm>
#include <errno.h>
-
-#include "build_log.h"
-#include "manifest_parser.h"
-#include "util.h"
-
#ifdef _WIN32
#include <windows.h>
#else
#include <unistd.h>
#endif
+#include "build_log.h"
+#include "manifest_parser.h"
+#include "util.h"
+
namespace {
#ifdef _WIN32