OSDN Git Service

Test for _WIN32 in system/extras instead of USE_MINGW.
authorElliott Hughes <enh@google.com>
Wed, 5 Oct 2016 16:44:48 +0000 (09:44 -0700)
committerElliott Hughes <enh@google.com>
Wed, 5 Oct 2016 16:44:48 +0000 (09:44 -0700)
Bug: http://b/23392815
Test: builds
Change-Id: Ide007c7ac8414a82548cc99fe384c7de9ba7494b

ext4_utils/contents.c
ext4_utils/ext2simg.c
ext4_utils/ext4_utils.c
ext4_utils/ext4fixup.c
ext4_utils/make_ext4fs.c
ext4_utils/make_ext4fs_main.c
ext4_utils/sha1.c
ext4_utils/sha1.h
f2fs_utils/f2fs_ioutils.c
f2fs_utils/make_f2fs_main.c

index 2e3d903..e66573e 100644 (file)
@@ -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
 
index e5b36c4..f467266 100644 (file)
@@ -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
 
index fba4f9f..f358960 100644 (file)
@@ -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;
index 4b40207..09602b6 100644 (file)
@@ -27,7 +27,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 
-#ifndef USE_MINGW
+#ifndef _WIN32
 #include <sys/mman.h>
 #endif
 
index f45a699..744cf0a 100644 (file)
@@ -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;
 
index 323a445..1343cc6 100644 (file)
@@ -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) {
index 5a8a02f..589b69a 100644 (file)
@@ -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>
index 9a8f7e3..40e9acf 100644 (file)
@@ -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;
index 01efd53..4c12096 100644 (file)
@@ -51,7 +51,7 @@ struct selabel_handle;
 
 #include "make_f2fs.h"
 
-#ifdef USE_MINGW
+#ifdef _WIN32
 
 #include <winsock2.h>
 
index 1e0dd87..bceb23c 100644 (file)
@@ -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