]> wimlib.net Git - wimlib/blobdiff - programs/imagex.c
Fix clang warnings about inconsistent use of dllexport
[wimlib] / programs / imagex.c
index 809836cd70b09558937600aae4a5547e87ee6e3b..c0b68020e2055c7729b7bde34cea501ad7e3f653 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 /*
- * Copyright (C) 2012-2021 Eric Biggers
+ * Copyright (C) 2012-2023 Eric Biggers
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 
 #define WIMLIB_COMPRESSION_TYPE_INVALID (-1)
 
-#ifdef __WIN32__
+#ifdef _WIN32
 #  include "imagex-win32.h"
 #  define print_security_descriptor     win32_print_security_descriptor
-#else /* __WIN32__ */
+#else /* _WIN32 */
 #  include <getopt.h>
 #  include <langinfo.h>
 #  define print_security_descriptor    default_print_security_descriptor
@@ -62,13 +62,13 @@ static inline void set_fd_to_binary_mode(int fd)
 #ifndef HAVE_GETOPT_LONG_ONLY
 #  define getopt_long_only getopt_long
 #endif
-#endif /* !__WIN32 */
+#endif /* !_WIN32 */
 
 /* Don't confuse the user by presenting the mounting commands on Windows when
  * they will never work.  However on UNIX-like systems we always present them,
  * even if WITH_FUSE is not defined at this point, as to not tie the build of
  * wimlib-imagex to a specific build of wimlib.  */
-#ifdef __WIN32__
+#ifdef _WIN32
 #  define WIM_MOUNTING_SUPPORTED 0
 #else
 #  define WIM_MOUNTING_SUPPORTED 1
@@ -1055,12 +1055,12 @@ stdin_get_contents(size_t *len_ret)
 static tchar *
 translate_text_to_tstr(char *text, size_t num_bytes, size_t *num_tchars_ret)
 {
-#ifndef __WIN32__
+#ifndef _WIN32
        /* On non-Windows, assume an ASCII-compatible encoding, such as UTF-8.
         * */
        *num_tchars_ret = num_bytes;
        return text;
-#else /* !__WIN32__ */
+#else /* !_WIN32 */
        /* On Windows, translate the text to UTF-16LE */
        wchar_t *text_wstr;
        size_t num_wchars;
@@ -1087,7 +1087,7 @@ translate_text_to_tstr(char *text, size_t num_bytes, size_t *num_tchars_ret)
        }
        *num_tchars_ret = num_wchars;
        return text_wstr;
-#endif /* __WIN32__ */
+#endif /* _WIN32 */
 }
 
 static tchar *
@@ -1265,7 +1265,7 @@ imagex_progress_func(enum wimlib_progress_msg msg,
                         * default installation.  On UNIX-like systems, warn the
                         * user when fixing the target of an absolute symbolic
                         * link, so they know to disable this if they want.  */
-               #ifndef __WIN32__
+               #ifndef _WIN32
                        imagex_printf(T("\nWARNING: Adjusted target of "
                                        "absolute symbolic link \"%"TS"\"\n"
                                        "           (Use --norpfix to capture "
@@ -1817,7 +1817,7 @@ imagex_apply(int argc, tchar **argv, int cmd)
                        goto out_wimlib_free;
        }
 
-#ifndef __WIN32__
+#ifndef _WIN32
        {
                /* Interpret a regular file or block device target as an NTFS
                 * volume.  */
@@ -2040,7 +2040,7 @@ imagex_capture_or_append(int argc, tchar **argv, int cmd)
                                        template_image_name_or_num = optarg;
                                }
                        }
-               #ifdef __WIN32__
+               #ifdef _WIN32
                        imagex_printf(T("[WARNING] '--update-of' is unreliable on Windows!\n"));
                #endif
                        break;
@@ -2278,7 +2278,7 @@ imagex_capture_or_append(int argc, tchar **argv, int cmd)
                        goto out_free_wim;
        }
 
-#ifndef __WIN32__
+#ifndef _WIN32
        /* Detect if source is regular file or block device and set NTFS volume
         * capture mode.  */
        if (!source_list) {
@@ -2721,7 +2721,7 @@ print_blobs(WIMStruct *wim)
        wimlib_iterate_lookup_table(wim, 0, print_resource, NULL);
 }
 
-#ifndef __WIN32__
+#ifndef _WIN32
 static void
 default_print_security_descriptor(const uint8_t *sd, size_t size)
 {
@@ -4006,7 +4006,7 @@ imagex_split(int argc, tchar **argv, int cmd)
        int c;
        int open_flags = 0;
        int write_flags = 0;
-       unsigned long part_size;
+       uint64_t part_size;
        tchar *tmp;
        int ret;
        WIMStruct *wim;
@@ -4460,7 +4460,7 @@ static const struct imagex_command imagex_commands[] = {
        [CMD_VERIFY]   = {T("verify"),   imagex_verify},
 };
 
-#ifdef __WIN32__
+#ifdef _WIN32
 
    /* Can be a directory or source list file.  But source list file is probably
     * a rare use case, so just say directory.  */
@@ -4612,7 +4612,7 @@ version(void)
        static const tchar * const fmt =
        T(
 "wimlib-imagex " PACKAGE_VERSION " (using wimlib %"TS")\n"
-"Copyright (C) 2012-2021 Eric Biggers\n"
+"Copyright (C) 2012-2023 Eric Biggers\n"
 "License GPLv3+; GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.\n"
 "This is free software: you are free to change and redistribute it.\n"
 "There is NO WARRANTY, to the extent permitted by law.\n"
@@ -4666,7 +4666,7 @@ static void
 recommend_man_page(int cmd, FILE *fp)
 {
        const tchar *format_str;
-#ifdef __WIN32__
+#ifdef _WIN32
        format_str = T("Some uncommon options are not listed;\n"
                       "See %"TS".pdf in the doc directory for more details.\n");
 #else
@@ -4707,7 +4707,7 @@ usage_all(FILE *fp)
        recommend_man_page(CMD_NONE, fp);
 }
 
-#ifdef __WIN32__
+#ifdef _WIN32
 extern int wmain(int argc, wchar_t **argv);
 #define main wmain
 #endif