]> wimlib.net Git - wimlib/blobdiff - src/resource.c
re-organize win32 code
[wimlib] / src / resource.c
index eb79c7498c98a2e0b7d78129dad067c5df3d9643..db9c635bc4ce4f125ed4281da17cec6b7461be29 100644 (file)
 #include "xpress.h"
 #include "sha1.h"
 
+#ifdef __WIN32__
+#  include "win32.h"
+#endif
+
 #include <errno.h>
 #include <stdarg.h>
 #include <stdlib.h>
 #include <unistd.h>
 
 #ifdef WITH_NTFS_3G
-#include <time.h>
-#include <ntfs-3g/attrib.h>
-#include <ntfs-3g/inode.h>
-#include <ntfs-3g/dir.h>
+#  include <time.h>
+#  include <ntfs-3g/attrib.h>
+#  include <ntfs-3g/inode.h>
+#  include <ntfs-3g/dir.h>
 #endif
 
 /*
@@ -279,9 +283,9 @@ static int read_compressed_resource(FILE *fp, u64 resource_compressed_size,
                bool is_partial_chunk = (partial_chunk_size !=
                                                uncompressed_chunk_size);
 
-               DEBUG2("start_offset = %u, end_offset = %u", start_offset,
-                                       end_offset);
-               DEBUG2("partial_chunk_size = %u", partial_chunk_size);
+               DEBUG2("start_offset = %"PRIu64", end_offset = %"PRIu64"",
+                      start_offset, end_offset);
+               DEBUG2("partial_chunk_size = %"PRIu64"", partial_chunk_size);
 
                /* This is undocumented, but chunks can be uncompressed.  This
                 * appears to always be the case when the compressed chunk size
@@ -558,7 +562,7 @@ int read_wim_resource(const struct wim_lookup_table_entry *lte, u8 buf[],
                if (fp != lte->file_on_disk_fp)
                        fclose(fp);
                break;
-#if defined(__CYGWIN__) || defined(__WIN32__)
+#ifdef __WIN32__
        case RESOURCE_WIN32:
                wimlib_assert(lte->file_on_disk_fp != NULL);
                ret = win32_read_file(lte->file_on_disk, lte->file_on_disk_fp,