]> wimlib.net Git - wimlib/commitdiff
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 9ab141f1543968efc24da15f02bd95c909511890..dd3c5c9c1c24dd72cc0c2ece75649d164b3e391b 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 0569b176fcbf2a9842585c7b6e0962bc3d8cf490..9b3c8521e34e87a52936b7c9af1cce1d0e5dd973 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 06f09f5dae080aa54486b02b7880eb349a5de70d..49f83294ca277060683811ce1bc6a842db681f9b 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 9359c53fa64c0bcc8242c1c823543dbb06df6749..b14489379d0275e3b734e73c81e4af02fb7a2a70 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 9455ed63ad0cd6cec4abdd5f9d645738059d2d33..317a00d03b61df66d083c93162dcf5ed303256b6 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 fb1047e0c01d471bc0d28f07aca863ea6eb85489..134821971a6b3b20e4b6d79f520be219ab6c1dbc 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 600176e698841f56a3c1bbe4f0d81ec2fe3f3ee7..ff43ba59e5deda4921dec2d728fb800224d9e13d 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 a71359420aed78ade13a05b0f2523c645974e1c2..e33759a2abf06df184ac1282f5f38615717fc280 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"