Don't include windows.h in semaphore.h

semaphore.h is included often, and windows.h is large and slow to parse.

Change-Id: Ia7e8a3d1739dc24d9f99a2e14e122acb2518fd3b
Reviewed-on: https://gn-review.googlesource.com/c/gn/+/6643
Commit-Queue: Scott Graham <scottmg@chromium.org>
Reviewed-by: Scott Graham <scottmg@chromium.org>
diff --git a/src/gn/function_write_file_unittest.cc b/src/gn/function_write_file_unittest.cc
index fa8900d..78eefc5 100644
--- a/src/gn/function_write_file_unittest.cc
+++ b/src/gn/function_write_file_unittest.cc
@@ -17,6 +17,10 @@
 #include <sys/time.h>
 #endif
 
+#if defined(OS_WIN)
+#include <windows.h>
+#endif
+
 namespace {
 
 // Returns true on success, false if write_file signaled an error.
diff --git a/src/util/semaphore.cc b/src/util/semaphore.cc
index e13ec53..afed45e 100644
--- a/src/util/semaphore.cc
+++ b/src/util/semaphore.cc
@@ -9,6 +9,10 @@
 
 #include "base/logging.h"
 
+#if defined(OS_WIN)
+#include <windows.h>
+#endif
+
 #if defined(OS_MACOSX)
 
 Semaphore::Semaphore(int count) {
diff --git a/src/util/semaphore.h b/src/util/semaphore.h
index 2952cae..8632713 100644
--- a/src/util/semaphore.h
+++ b/src/util/semaphore.h
@@ -12,7 +12,7 @@
 #include "util/build_config.h"
 
 #if defined(OS_WIN)
-#include <windows.h>
+#include "base/win/windows_types.h"
 #elif defined(OS_MACOSX)
 #include <dispatch/dispatch.h>
 #elif defined(OS_POSIX)