aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2022-04-21 15:18:12 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2022-04-22 11:43:13 -0700
commitf3033fbc8ab80a026740171cdbad44d8bd5fd882 (patch)
tree2c4e157d7ed3f33f0247cca85334e0eac41e424e
parent87d7a95e3134b668e9f1e8519a19f390509fac60 (diff)
downloadf2fs-tools-f3033fbc8ab80a026740171cdbad44d8bd5fd882.tar.gz
Change the ANDROID_WINDOWS_HOST macro into _WIN32
This makes it easier to build f2fs-tools for Windows. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--include/f2fs_fs.h2
-rw-r--r--lib/libf2fs.c10
-rw-r--r--lib/libf2fs_io.c6
-rw-r--r--lib/libf2fs_zoned.c2
-rw-r--r--mkfs/f2fs_format.c2
-rw-r--r--mkfs/f2fs_format_main.c2
-rw-r--r--mkfs/f2fs_format_utils.c4
7 files changed, 14 insertions, 14 deletions
diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h
index e188f38..5b81b72 100644
--- a/include/f2fs_fs.h
+++ b/include/f2fs_fs.h
@@ -68,7 +68,7 @@
# define UNUSED(x) x
#endif
-#ifdef ANDROID_WINDOWS_HOST
+#ifdef _WIN32
#undef HAVE_LINUX_TYPES_H
#endif
diff --git a/lib/libf2fs.c b/lib/libf2fs.c
index e3117d8..8bec68c 100644
--- a/lib/libf2fs.c
+++ b/lib/libf2fs.c
@@ -22,7 +22,7 @@
#endif
#include <time.h>
#include <sys/stat.h>
-#ifndef ANDROID_WINDOWS_HOST
+#ifndef _WIN32
#include <sys/mount.h>
#include <sys/ioctl.h>
#endif
@@ -49,7 +49,7 @@
#define MODELINQUIRY 0x12,0x00,0x00,0x00,0x4A,0x00
#endif
-#ifndef ANDROID_WINDOWS_HOST /* O_BINARY is windows-specific flag */
+#ifndef _WIN32 /* O_BINARY is windows-specific flag */
#define O_BINARY 0
#else
/* On Windows, wchar_t is 8 bit sized and it causes compilation errors. */
@@ -606,7 +606,7 @@ int write_inode(struct f2fs_node *inode, u64 blkaddr)
*/
char *get_rootdev()
{
-#if defined(ANDROID_WINDOWS_HOST) || defined(WITH_ANDROID)
+#if defined(_WIN32) || defined(WITH_ANDROID)
return NULL;
#else
struct stat sb;
@@ -740,7 +740,7 @@ static int is_mounted(const char *mpt, const char *device)
int f2fs_dev_is_umounted(char *path)
{
-#ifdef ANDROID_WINDOWS_HOST
+#ifdef _WIN32
return 0;
#else
struct stat *st_buf;
@@ -872,7 +872,7 @@ void get_kernel_uname_version(__u8 *version)
#define BLKSSZGET DKIOCGETBLOCKCOUNT
#endif /* APPLE_DARWIN */
-#ifndef ANDROID_WINDOWS_HOST
+#ifndef _WIN32
static int open_check_fs(char *path, int flag)
{
if (c.func != DUMP && (c.func != FSCK || c.fix_on || c.auto_fix))
diff --git a/lib/libf2fs_io.c b/lib/libf2fs_io.c
index b985e6f..bf6dfe2 100644
--- a/lib/libf2fs_io.c
+++ b/lib/libf2fs_io.c
@@ -23,7 +23,7 @@
#include <mntent.h>
#endif
#include <time.h>
-#ifndef ANDROID_WINDOWS_HOST
+#ifndef _WIN32
#include <sys/stat.h>
#include <sys/mount.h>
#include <sys/ioctl.h>
@@ -634,7 +634,7 @@ int dev_reada_block(__u64 blk_addr)
int f2fs_fsync_device(void)
{
-#ifndef ANDROID_WINDOWS_HOST
+#ifndef _WIN32
int i;
for (i = 0; i < c.ndevs; i++) {
@@ -783,7 +783,7 @@ int f2fs_finalize_device(void)
* in the block device page cache.
*/
for (i = 0; i < c.ndevs; i++) {
-#ifndef ANDROID_WINDOWS_HOST
+#ifndef _WIN32
ret = fsync(c.devices[i].fd);
if (ret < 0) {
MSG(0, "\tError: Could not conduct fsync!!!\n");
diff --git a/lib/libf2fs_zoned.c b/lib/libf2fs_zoned.c
index 546024c..2dfed79 100644
--- a/lib/libf2fs_zoned.c
+++ b/lib/libf2fs_zoned.c
@@ -22,7 +22,7 @@
#ifdef HAVE_LINUX_LIMITS_H
#include <linux/limits.h>
#endif
-#ifndef ANDROID_WINDOWS_HOST
+#ifndef _WIN32
#include <sys/ioctl.h>
#endif
#include <libgen.h>
diff --git a/mkfs/f2fs_format.c b/mkfs/f2fs_format.c
index 8bd33ac..332abf6 100644
--- a/mkfs/f2fs_format.c
+++ b/mkfs/f2fs_format.c
@@ -13,7 +13,7 @@
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
-#ifndef ANDROID_WINDOWS_HOST
+#ifndef _WIN32
#include <sys/stat.h>
#include <sys/mount.h>
#endif
diff --git a/mkfs/f2fs_format_main.c b/mkfs/f2fs_format_main.c
index d05d4e2..ecc942b 100644
--- a/mkfs/f2fs_format_main.c
+++ b/mkfs/f2fs_format_main.c
@@ -15,7 +15,7 @@
#include <stdbool.h>
#include <unistd.h>
#include <sys/stat.h>
-#ifndef ANDROID_WINDOWS_HOST
+#ifndef _WIN32
#include <sys/mount.h>
#endif
#include <time.h>
diff --git a/mkfs/f2fs_format_utils.c b/mkfs/f2fs_format_utils.c
index e84311a..53101d1 100644
--- a/mkfs/f2fs_format_utils.c
+++ b/mkfs/f2fs_format_utils.c
@@ -26,7 +26,7 @@
#include <unistd.h>
#include <stdlib.h>
#include <stdbool.h>
-#ifndef ANDROID_WINDOWS_HOST
+#ifndef _WIN32
#include <sys/ioctl.h>
#endif
#include <sys/stat.h>
@@ -48,7 +48,7 @@
static int trim_device(int i)
{
-#ifndef ANDROID_WINDOWS_HOST
+#ifndef _WIN32
unsigned long long range[2];
struct stat *stat_buf;
struct device_info *dev = c.devices + i;