]> wimlib.net Git - wimlib/blobdiff - src/resource.c
Win32 apply: Set short names
[wimlib] / src / resource.c
index 1b53ee40342cf6f5258b4b9bd0b508d4f8fc4500..c7eedab0ad61663b30ea7f2045c6553945a90be0 100644 (file)
@@ -463,9 +463,9 @@ put_resource_entry(void *p, const struct resource_entry *entry)
 static FILE *
 wim_get_fp(WIMStruct *w)
 {
+       FILE *fp;
 #if defined(WITH_FUSE) || defined(ENABLE_MULTITHREADED_COMPRESSION)
        pthread_mutex_lock(&w->fp_tab_mutex);
-       FILE *fp;
 
        wimlib_assert(w->filename != NULL);
 
@@ -630,6 +630,7 @@ read_wim_resource_prefix(const struct wim_lookup_table_entry *lte,
 }
 
 
+#ifndef __WIN32__
 static int
 read_file_on_disk_prefix(const struct wim_lookup_table_entry *lte,
                         u64 size,
@@ -676,6 +677,7 @@ out_close:
        close(fd);
        return ret;
 }
+#endif /* !__WIN32__ */
 
 static int
 read_buffer_prefix(const struct wim_lookup_table_entry *lte,
@@ -732,7 +734,9 @@ read_resource_prefix(const struct wim_lookup_table_entry *lte,
 {
        static const read_resource_prefix_handler_t handlers[] = {
                [RESOURCE_IN_WIM]             = read_wim_resource_prefix,
+       #ifndef __WIN32__
                [RESOURCE_IN_FILE_ON_DISK]    = read_file_on_disk_prefix,
+       #endif
                [RESOURCE_IN_ATTACHED_BUFFER] = read_buffer_prefix,
        #ifdef WITH_FUSE
                [RESOURCE_IN_STAGING_FILE]    = read_file_on_disk_prefix,
@@ -808,8 +812,8 @@ extract_wim_resource(const struct wim_lookup_table_entry *lte,
                                print_lookup_table_entry(lte, stderr);
                                if (lte->resource_location == RESOURCE_IN_WIM)
                                        ERROR("The WIM file appears to be corrupt!");
-                               ret = WIMLIB_ERR_INVALID_RESOURCE_HASH;
                        #endif
+                               ret = WIMLIB_ERR_INVALID_RESOURCE_HASH;
                        }
                }
        } else {