_WIN32 is the standard macro to detect (native) Windows, regardless of
32-bit or 64-bit. _WIN64 is for 64-bit Windows only. Use _WIN32 where
_WIN64 was incorrectly being used.
This fixes several 32-bit Windows build errors, for example this one:
plausible.c: In function ‘print_ext2_info’:
plausible.c:109:31: error: ‘unix_io_manager’ undeclared (first use in this function); did you mean ‘undo_io_manager’?
109 | unix_io_manager,
| ^~~~~~~~~~~~~~~
| undo_io_manager
Fixes:
86b6db9f5a43 ("libext2fs: code adaptation to use the Windows IO manager")
Cc: Paulo Antonio Alvarez <pauloaalvarez@gmail.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
*/
errcode_t ext2fs_get_device_sectsize(const char *file, int *sectsize)
{
-#ifdef _WIN64
+#ifdef _WIN32
*sectsize = 512; // just guessing
return 0;
-#else // not _WIN64
+#else // not _WIN32
int fd;
close(fd);
return 0;
-#endif // ifdef _WIN64
+#endif // ifdef _WIN32
}
/*
*/
errcode_t ext2fs_get_device_phys_sectsize(const char *file, int *sectsize)
{
-#ifdef _WIN64
+#ifdef _WIN32
return ext2fs_get_device_sectsize(file, sectsize);
-#else // not _WIN64
+#else // not _WIN32
int fd;
close(fd);
return 0;
-#endif // ifdef _WIN64
+#endif // ifdef _WIN32
}
time_t tm;
retval = ext2fs_open2(device, 0, EXT2_FLAG_64BITS, 0, 0,
-#ifdef _WIN64
+#ifdef _WIN32
windows_io_manager,
#else
unix_io_manager,
printf("Using original atime\n");
set_utimes(outfn, fileno(old), tv);
}
-#ifndef _WIN64
+#ifndef _WIN32
if (ofd >= 0)
(void) fchmod(ofd, 0444);
#endif
} else {
if (verbose)
printf("Creating or replacing %s.\n", outfn);
-#ifndef _WIN64
+#ifndef _WIN32
if (ofd >= 0)
(void) fchmod(ofd, 0444);
#endif