From 9c4d58824c53710f891cfab234bf0bc697030ebe Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Wed, 21 Nov 2012 20:29:35 -0600 Subject: [PATCH] Header and ifdef fixes --- programs/imagex.c | 20 +++++++++----------- src/modify.c | 4 ++-- src/wimlib.h | 1 + src/wimlib_internal.h | 8 ++++---- src/write.c | 3 ++- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/programs/imagex.c b/programs/imagex.c index 61a93fbe..2547b078 100644 --- a/programs/imagex.c +++ b/programs/imagex.c @@ -22,26 +22,27 @@ * along with this program. If not, see . */ -#include "wimlib.h" #include "config.h" + +#include "wimlib.h" + +#include #include -#include -#include #include -#include -#include +#include #include #include +#include +#include +#include #include #include -#include #define ARRAY_LEN(array) (sizeof(array) / sizeof(array[0])) #define for_opt(c, opts) while ((c = getopt_long_only(argc, (char**)argv, "", \ opts, NULL)) != -1) - enum imagex_op_type { APPEND, APPLY, @@ -610,7 +611,6 @@ static int imagex_apply(int argc, const char **argv) goto out; } -#ifdef WITH_NTFS_3G struct stat stbuf; ret = stat(target, &stbuf); @@ -627,7 +627,6 @@ static int imagex_apply(int argc, const char **argv) goto out; } } -#endif ret = wimlib_extract_image(w, image, target, extract_flags, additional_swms, num_additional_swms, @@ -733,7 +732,6 @@ static int imagex_capture_or_append(int argc, const char **argv) if (ret != 0) goto out; -#ifdef WITH_NTFS_3G struct stat stbuf; ret = stat(source, &stbuf); @@ -750,7 +748,7 @@ static int imagex_capture_or_append(int argc, const char **argv) goto out; } } -#endif + ret = wimlib_add_image(w, source, name, config_str, config_len, add_image_flags, imagex_progress_func); diff --git a/src/modify.c b/src/modify.c index 3403eb32..ee6edb17 100644 --- a/src/modify.c +++ b/src/modify.c @@ -983,8 +983,8 @@ WIMLIBAPI int wimlib_add_image(WIMStruct *w, const char *source, capture_tree = build_dentry_tree_ntfs; extra_arg = &w->ntfs_vol; #else - ERROR("wimlib was compiled without support for NTFS-3g, so"); - ERROR("we cannot capture a WIM image directly from a NTFS volume"); + ERROR("wimlib was compiled without support for NTFS-3g, so\n" + " cannot capture a WIM image directly from a NTFS volume!"); return WIMLIB_ERR_UNSUPPORTED; #endif } else { diff --git a/src/wimlib.h b/src/wimlib.h index 1957f6ba..6033576b 100644 --- a/src/wimlib.h +++ b/src/wimlib.h @@ -530,6 +530,7 @@ union wimlib_progress_info { typedef int (*wimlib_progress_func_t)(enum wimlib_progress_msg msg_type, const union wimlib_progress_info *info); + /***************************** * WIMLIB_ADD_IMAGE_FLAG_* * *****************************/ diff --git a/src/wimlib_internal.h b/src/wimlib_internal.h index b0a0aa29..ac35c4fc 100644 --- a/src/wimlib_internal.h +++ b/src/wimlib_internal.h @@ -31,6 +31,8 @@ #include "util.h" #include "list.h" +#include "wimlib.h" + #ifdef WITH_FUSE #include #endif @@ -39,8 +41,6 @@ struct stat; struct dentry; struct inode; -#include "wimlib.h" - #define WIM_MAGIC_LEN 8 #define WIM_GID_LEN 16 #define WIM_UNUSED_LEN 60 @@ -259,7 +259,7 @@ struct image_metadata { #define WIMLIB_RESOURCE_FLAG_RECOMPRESS 0x4 /* The opaque structure exposed to the wimlib API. */ -typedef struct WIMStruct { +struct WIMStruct { /* A pointer to the file indicated by @filename, opened for reading. */ FILE *fp; @@ -310,7 +310,7 @@ typedef struct WIMStruct { /* %true iff any images have been deleted from this WIM. */ bool deletion_occurred; -} WIMStruct; +}; /* Inline utility functions for WIMStructs. */ diff --git a/src/write.c b/src/write.c index a08bc850..b143f16d 100644 --- a/src/write.c +++ b/src/write.c @@ -37,9 +37,10 @@ #ifdef ENABLE_MULTITHREADED_COMPRESSION #include #include -#include #endif +#include + #ifdef WITH_NTFS_3G #include #include -- 2.43.0