Make win32.h includable on non-Windows
authorEric Biggers <ebiggers3@gmail.com>
Sat, 2 May 2015 22:47:07 +0000 (17:47 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Sat, 2 May 2015 23:13:41 +0000 (18:13 -0500)
include/wimlib/win32.h
src/compress_parallel.c
src/error.c
src/extract.c
src/file_io.c
src/resource.c
src/wim.c
src/write.c

index 9ab141f..dd3c5c9 100644 (file)
@@ -1,9 +1,7 @@
 #ifndef _WIMLIB_WIN32_H
 #define _WIMLIB_WIN32_H
 
-#ifndef __WIN32__
-#  error "This header is for Win32 only"
-#endif
+#ifdef __WIN32__
 
 #include "wimlib/callback.h"
 #include "wimlib/types.h"
@@ -56,4 +54,6 @@ pread(int fd, void *buf, size_t count, off_t offset);
 extern ssize_t
 pwrite(int fd, const void *buf, size_t count, off_t offset);
 
+#endif /* __WIN32__ */
+
 #endif /* _WIMLIB_WIN32_H */
index 0569b17..9b3c852 100644 (file)
@@ -42,9 +42,7 @@
 #include "wimlib/error.h"
 #include "wimlib/list.h"
 #include "wimlib/util.h"
-#ifdef __WIN32__
-#  include "wimlib/win32.h" /* win32_get_number_of_processors() */
-#endif
+#include "wimlib/win32.h" /* win32_get_number_of_processors() */
 
 struct message_queue {
        struct list_head list;
index 06f09f5..49f8329 100644 (file)
@@ -43,9 +43,7 @@
 #include "wimlib.h"
 #include "wimlib/error.h"
 #include "wimlib/util.h"
-#ifdef __WIN32__
-#  include "wimlib/win32.h"
-#endif
+#include "wimlib/win32.h"
 
 #ifdef ENABLE_ERROR_MESSAGES
 bool wimlib_print_errors = false;
index 9359c53..b144893 100644 (file)
 #include "wimlib/resource.h"
 #include "wimlib/security.h"
 #include "wimlib/unix_data.h"
-#ifdef __WIN32__
-#  include "wimlib/win32.h" /* for realpath() equivalent */
-#endif
-#include "wimlib/xml.h"
 #include "wimlib/wildcard.h"
 #include "wimlib/wim.h"
+#include "wimlib/win32.h" /* for realpath() equivalent */
+#include "wimlib/xml.h"
 
 #define WIMLIB_EXTRACT_FLAG_FROM_PIPE   0x80000000
 #define WIMLIB_EXTRACT_FLAG_IMAGEMODE   0x40000000
index 9455ed6..317a00d 100644 (file)
@@ -29,9 +29,7 @@
 #include "wimlib/error.h"
 #include "wimlib/file_io.h"
 #include "wimlib/util.h"
-#ifdef __WIN32__
-#  include "wimlib/win32.h" /* For pread(), pwrite() replacements */
-#endif
+#include "wimlib/win32.h" /* For pread(), pwrite() replacements */
 
 /* Wrapper around read() that checks for errors keeps retrying until all
  * requested bytes have been read or until end-of file has occurred.
index fb1047e..1348219 100644 (file)
 #include "wimlib/endianness.h"
 #include "wimlib/error.h"
 #include "wimlib/file_io.h"
-#include "wimlib/ntfs_3g.h" /* for read_ntfs_attribute_prefix() */
+#include "wimlib/ntfs_3g.h"
 #include "wimlib/resource.h"
 #include "wimlib/sha1.h"
 #include "wimlib/wim.h"
-
-#ifdef __WIN32__
-/* for read_winnt_stream_prefix(), read_win32_encrypted_file_prefix() */
-#  include "wimlib/win32.h"
-#endif
+#include "wimlib/win32.h"
 
 /*
  *                         Compressed WIM resources
index 600176e..ff43ba5 100644 (file)
--- a/src/wim.c
+++ b/src/wim.c
@@ -44,9 +44,7 @@
 #include "wimlib/security.h"
 #include "wimlib/wim.h"
 #include "wimlib/xml.h"
-#ifdef __WIN32__
-#  include "wimlib/win32.h" /* for realpath() replacement */
-#endif
+#include "wimlib/win32.h"
 
 /* Information about the available compression types for the WIM format.  */
 static const struct {
index a713594..e33759a 100644 (file)
@@ -52,9 +52,7 @@
 #include "wimlib/progress.h"
 #include "wimlib/resource.h"
 #include "wimlib/solid.h"
-#ifdef __WIN32__
-#  include "wimlib/win32.h" /* win32_rename_replacement() */
-#endif
+#include "wimlib/win32.h" /* win32_rename_replacement() */
 #include "wimlib/write.h"
 #include "wimlib/xml.h"