]> wimlib.net Git - wimlib/blobdiff - src/wimboot.c
wimboot.c: Fix error number printing
[wimlib] / src / wimboot.c
index beb4eab6baafbcdc07cf41b7c317b963e75230b6..9270d41587d74c49b2af2c234bb4e32c4cea700b 100644 (file)
  * along with wimlib; if not, see http://www.gnu.org/licenses/.
  */
 
-#ifndef __WIN32__
-#  error "This file contains Windows code!"
-#endif
 
 #ifdef HAVE_CONFIG_H
 #  include "config.h"
 #endif
 
+#ifdef __WIN32__
+
 #include "wimlib/win32_common.h"
 #include "wimlib/win32.h"
 #include "wimlib/assert.h"
@@ -210,7 +209,7 @@ retry_ioctl:
                } else {
                        set_errno_from_win32_error(err);
                        ERROR_WITH_ERRNO("Failed to add overlay source \"%ls\" "
-                                        "to volume \"%ls\" (err=0x%08"PRIu32")",
+                                        "to volume \"%ls\" (err=0x%08"PRIx32")",
                                         wim_path, drive_path + 4, (uint32_t)err);
                        ret = WIMLIB_ERR_WIMBOOT;
                        goto out_close_handle;
@@ -283,7 +282,7 @@ wimboot_set_pointer(const wchar_t *path, u64 data_source_id,
                DWORD err = GetLastError();
                set_errno_from_win32_error(err);
                ERROR_WITH_ERRNO("\"%ls\": Couldn't set WIMBoot pointer data "
-                                "(err=0x%08x)", path, (uint32_t)err);
+                                "(err=0x%08"PRIx32")", path, (uint32_t)err);
                ret = WIMLIB_ERR_WIMBOOT;
                goto out_close_handle;
        }
@@ -293,3 +292,5 @@ out_close_handle:
 out:
        return ret;
 }
+
+#endif /* __WIN32__ */