Browse Source

Wrap windows-only C files in #ifdef _WIN32

This should make some scripts and IDEs happier.
Nick Mathewson 8 years ago
parent
commit
beac91cf08
3 changed files with 12 additions and 0 deletions
  1. 4 0
      changes/windows_only_files
  2. 4 0
      src/common/compat_winthreads.c
  3. 4 0
      src/or/ntmain.c

+ 4 - 0
changes/windows_only_files

@@ -0,0 +1,4 @@
+  o Code simplification and refactoring:
+    - Wrap windows-only C files inside '#ifdef _WIN32' so that tools that
+      try to scan or compile every file on Unix won't decide that they
+      are broken.

+ 4 - 0
src/common/compat_winthreads.c

@@ -3,6 +3,8 @@
  * Copyright (c) 2007-2015, The Tor Project, Inc. */
 /* See LICENSE for licensing information */
 
+#ifdef _WIN32
+
 #include "compat.h"
 #include <windows.h>
 #include <process.h>
@@ -194,3 +196,5 @@ tor_threads_init(void)
   set_main_thread();
 }
 
+#endif
+

+ 4 - 0
src/or/ntmain.c

@@ -3,6 +3,8 @@
  * Copyright (c) 2007-2015, The Tor Project, Inc. */
 /* See LICENSE for licensing information */
 
+#ifdef _WIN32
+
 #include "or.h"
 #include "config.h"
 #include "main.h"
@@ -764,3 +766,5 @@ nt_service_parse_options(int argc, char **argv, int *should_exit)
   return 0;
 }
 
+#endif
+