diff options
author | Elliott Hughes <enh@google.com> | 2016-10-05 09:44:48 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2016-10-05 09:44:48 -0700 |
commit | 1eb2f5433461ad437e7dfedca32ce7bf5f09fd21 (patch) | |
tree | a883e56ea9ac15e201226e03f776a502e6368611 | |
parent | 0a2b8b5ba2388626424abf88f36553212dd8b2d9 (diff) | |
download | extras-1eb2f5433461ad437e7dfedca32ce7bf5f09fd21.tar.gz |
Test for _WIN32 in system/extras instead of USE_MINGW.
Bug: http://b/23392815
Test: builds
Change-Id: Ide007c7ac8414a82548cc99fe384c7de9ba7494b
-rw-r--r-- | ext4_utils/contents.c | 2 | ||||
-rw-r--r-- | ext4_utils/ext2simg.c | 2 | ||||
-rw-r--r-- | ext4_utils/ext4_utils.c | 4 | ||||
-rw-r--r-- | ext4_utils/ext4fixup.c | 2 | ||||
-rw-r--r-- | ext4_utils/make_ext4fs.c | 14 | ||||
-rw-r--r-- | ext4_utils/make_ext4fs_main.c | 8 | ||||
-rw-r--r-- | ext4_utils/sha1.c | 3 | ||||
-rw-r--r-- | ext4_utils/sha1.h | 2 | ||||
-rw-r--r-- | f2fs_utils/f2fs_ioutils.c | 2 | ||||
-rw-r--r-- | f2fs_utils/make_f2fs_main.c | 2 |
10 files changed, 19 insertions, 22 deletions
diff --git a/ext4_utils/contents.c b/ext4_utils/contents.c index 2e3d903a..e66573e3 100644 --- a/ext4_utils/contents.c +++ b/ext4_utils/contents.c @@ -34,7 +34,7 @@ #include "extent.h" #include "indirect.h" -#ifdef USE_MINGW +#ifdef _WIN32 #define S_IFLNK 0 /* used by make_link, not needed under mingw */ #endif diff --git a/ext4_utils/ext2simg.c b/ext4_utils/ext2simg.c index e5b36c49..f4672666 100644 --- a/ext4_utils/ext2simg.c +++ b/ext4_utils/ext2simg.c @@ -35,7 +35,7 @@ #define off64_t off_t #endif -#ifndef USE_MINGW /* O_BINARY is windows-specific flag */ +#ifndef _WIN32 /* O_BINARY is windows-specific flag */ #define O_BINARY 0 #endif diff --git a/ext4_utils/ext4_utils.c b/ext4_utils/ext4_utils.c index fba4f9fa..f358960c 100644 --- a/ext4_utils/ext4_utils.c +++ b/ext4_utils/ext4_utils.c @@ -32,7 +32,7 @@ #include <stddef.h> #include <string.h> -#ifdef USE_MINGW +#ifdef _WIN32 #include <winsock2.h> #else #include <arpa/inet.h> @@ -537,7 +537,7 @@ u64 get_block_device_size(int fd) int is_block_device_fd(int fd) { -#ifdef USE_MINGW +#ifdef _WIN32 return 0; #else struct stat st; diff --git a/ext4_utils/ext4fixup.c b/ext4_utils/ext4fixup.c index 4b402072..09602b62 100644 --- a/ext4_utils/ext4fixup.c +++ b/ext4_utils/ext4fixup.c @@ -27,7 +27,7 @@ #include <fcntl.h> #include <unistd.h> -#ifndef USE_MINGW +#ifndef _WIN32 #include <sys/mman.h> #endif diff --git a/ext4_utils/make_ext4fs.c b/ext4_utils/make_ext4fs.c index f45a6990..744cf0af 100644 --- a/ext4_utils/make_ext4fs.c +++ b/ext4_utils/make_ext4fs.c @@ -34,7 +34,7 @@ #include <sys/stat.h> #include <sys/types.h> -#ifdef USE_MINGW +#ifdef _WIN32 #include <winsock2.h> @@ -116,7 +116,7 @@ static u32 build_default_directory_structure(const char *dir_path, inode_set_permissions(inode, dentries.mode, dentries.uid, dentries.gid, dentries.mtime); -#ifndef USE_MINGW +#ifndef _WIN32 if (sehnd) { char *path = NULL; char *secontext = NULL; @@ -135,7 +135,7 @@ static u32 build_default_directory_structure(const char *dir_path, return root_inode; } -#ifndef USE_MINGW +#ifndef _WIN32 /* Read a local directory and create the same tree in the generated filesystem. Calls itself recursively with each directory in the given directory. full_path is an absolute or relative path, with a trailing slash, to the @@ -230,7 +230,7 @@ static u32 build_directory_structure(const char *full_path, const char *dir_path error("can't set android permissions - built without android support"); #endif } -#ifndef USE_MINGW +#ifndef _WIN32 if (sehnd) { if (selabel_lookup(sehnd, &dentries[i].secon, dentries[i].path, stat.st_mode) < 0) { error("cannot lookup security context for %s", dentries[i].path); @@ -546,7 +546,7 @@ static int get_block_group(u32 block) { static void extract_base_fs_allocations(const char *directory, const char *mountpoint, FILE* base_alloc_file_in) { #define err_msg "base file badly formatted" -#ifndef USE_MINGW +#ifndef _WIN32 // FORMAT Version 1.0: filename blk_mapping const char *base_alloc_file_in_format = "%s %s"; const int base_file_format_param_count = 2; @@ -800,7 +800,7 @@ int make_ext4fs_internal(int fd, const char *_directory, const char *_target_out if (info.feat_compat & EXT4_FEATURE_COMPAT_RESIZE_INODE) ext4_create_resize_inode(); -#ifdef USE_MINGW +#ifdef _WIN32 // Windows needs only 'create an empty fs image' functionality assert(!directory); root_inode_num = build_default_directory_structure(mountpoint, sehnd); @@ -815,7 +815,7 @@ int make_ext4fs_internal(int fd, const char *_directory, const char *_target_out root_mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; inode_set_permissions(root_inode_num, root_mode, 0, 0, 0); -#ifndef USE_MINGW +#ifndef _WIN32 if (sehnd) { char *secontext = NULL; diff --git a/ext4_utils/make_ext4fs_main.c b/ext4_utils/make_ext4fs_main.c index 323a445b..1343cc6c 100644 --- a/ext4_utils/make_ext4fs_main.c +++ b/ext4_utils/make_ext4fs_main.c @@ -30,7 +30,7 @@ #include <private/canned_fs_config.h> #endif -#ifndef USE_MINGW +#ifndef _WIN32 #include <selinux/selinux.h> #include <selinux/label.h> #if !defined(HOST) @@ -43,7 +43,7 @@ struct selabel_handle; #include "make_ext4fs.h" #include "ext4_utils.h" -#ifndef USE_MINGW /* O_BINARY is windows-specific flag */ +#ifndef _WIN32 /* O_BINARY is windows-specific flag */ #define O_BINARY 0 #endif @@ -83,7 +83,7 @@ int main(int argc, char **argv) FILE* block_list_file = NULL; FILE* base_alloc_file_in = NULL; FILE* base_alloc_file_out = NULL; -#ifndef USE_MINGW +#ifndef _WIN32 struct selinux_opt seopts[] = { { SELABEL_OPT_PATH, "" } }; #endif @@ -144,7 +144,7 @@ int main(int argc, char **argv) fprintf(stderr, "Warning: -t (initialize inode tables) is deprecated\n"); break; case 'S': -#ifndef USE_MINGW +#ifndef _WIN32 seopts[0].value = optarg; sehnd = selabel_open(SELABEL_CTX_FILE, seopts, 1); if (!sehnd) { diff --git a/ext4_utils/sha1.c b/ext4_utils/sha1.c index 5a8a02fb..589b69a4 100644 --- a/ext4_utils/sha1.c +++ b/ext4_utils/sha1.c @@ -17,9 +17,6 @@ #define SHA1HANDSOFF /* Copies data before messing with it. */ -#ifndef USE_MINGW -#include <sys/cdefs.h> -#endif #include <sys/types.h> #include <assert.h> #include <string.h> diff --git a/ext4_utils/sha1.h b/ext4_utils/sha1.h index 9a8f7e32..40e9acf5 100644 --- a/ext4_utils/sha1.h +++ b/ext4_utils/sha1.h @@ -12,7 +12,7 @@ #include <sys/types.h> #include <stdint.h> -#ifdef USE_MINGW +#ifdef _WIN32 typedef unsigned char u_char; typedef unsigned int uint32_t; typedef unsigned int u_int32_t; diff --git a/f2fs_utils/f2fs_ioutils.c b/f2fs_utils/f2fs_ioutils.c index 01efd53f..4c120966 100644 --- a/f2fs_utils/f2fs_ioutils.c +++ b/f2fs_utils/f2fs_ioutils.c @@ -51,7 +51,7 @@ struct selabel_handle; #include "make_f2fs.h" -#ifdef USE_MINGW +#ifdef _WIN32 #include <winsock2.h> diff --git a/f2fs_utils/make_f2fs_main.c b/f2fs_utils/make_f2fs_main.c index 1e0dd876..bceb23cd 100644 --- a/f2fs_utils/make_f2fs_main.c +++ b/f2fs_utils/make_f2fs_main.c @@ -29,7 +29,7 @@ #include "make_f2fs.h" -#ifndef USE_MINGW /* O_BINARY is windows-specific flag */ +#ifndef _WIN32 /* O_BINARY is windows-specific flag */ #define O_BINARY 0 #endif |