]> wimlib.net Git - wimlib/commitdiff
Remove some unnecessary configure options
authorEric Biggers <ebiggers3@gmail.com>
Sun, 31 Jul 2022 02:03:42 +0000 (19:03 -0700)
committerEric Biggers <ebiggers3@gmail.com>
Sun, 31 Jul 2022 02:03:42 +0000 (19:03 -0700)
Remove support for the following options which aren't really useful and
probably aren't being used by anyone:

* --disable-assertions
* --disable-error-messages
* --disable-multithreaded-compression

configure.ac
include/wimlib.h
include/wimlib/assert.h
include/wimlib/chunk_compressor.h
include/wimlib/error.h
src/compress_parallel.c
src/error.c
src/resource.c
src/wim.c
src/write.c

index 2b0650f888c497adb8bdbc2c31770666d53fe657..81e756d6b03c0eec50879aa83373142e6515afcf 100644 (file)
@@ -224,38 +224,6 @@ AM_CONDITIONAL([ENABLE_SSSE3_SHA1], [test "$ENABLE_SSSE3_SHA1" = "yes"])
 
 # ----------------------------- Other options ---------------------------------
 
-AC_MSG_CHECKING([whether to include error messages])
-AC_ARG_ENABLE([error_messages],
-       AS_HELP_STRING([--disable-error-messages], [do not compile in error messages]),
-       [ENABLE_ERROR_MESSAGES=$enableval],
-       [ENABLE_ERROR_MESSAGES=yes])
-AC_MSG_RESULT([$ENABLE_ERROR_MESSAGES])
-if test "$ENABLE_ERROR_MESSAGES" = "yes"; then
-       AC_DEFINE([ENABLE_ERROR_MESSAGES], [1], [Define to 1 if including error messages])
-fi
-
-AC_MSG_CHECKING([whether to include assertions])
-AC_ARG_ENABLE([assertions],
-       AS_HELP_STRING([--disable-assertions], [do not include assertions]),
-       [ENABLE_ASSERTIONS=$enableval],
-       [ENABLE_ASSERTIONS=yes])
-AC_MSG_RESULT([$ENABLE_ASSERTIONS])
-if test "$ENABLE_ASSERTIONS" = "yes"; then
-       AC_DEFINE([ENABLE_ASSERTIONS], [1], [Define to 1 if including assertions])
-fi
-
-AC_MSG_CHECKING([whether to include support for multi-threaded compression])
-AC_ARG_ENABLE([multithreaded-compression],
-       AS_HELP_STRING([--disable-multithreaded-compression],
-                      [disable support for multithreaded compression]),
-       [ENABLE_MULTITHREADED_COMPRESSION=$enableval],
-       [ENABLE_MULTITHREADED_COMPRESSION=yes])
-AC_MSG_RESULT([$ENABLE_MULTITHREADED_COMPRESSION])
-if test "$ENABLE_MULTITHREADED_COMPRESSION" = "yes"; then
-       AC_DEFINE([ENABLE_MULTITHREADED_COMPRESSION], [1],
-                 [Define to 1 to support multithreaded compression])
-fi
-
 AC_ARG_WITH(pkgconfigdir,
             [  --with-pkgconfigdir=DIR      pkgconfig file in DIR @<:@LIBDIR/pkgconfig@:>@],
             [pkgconfigdir=$withval],
index f5c9e0e842666b7651b3882b8e9972f7dda62208..43e971b124111ad2f10f47bbd51a1d681c8c6b67 100644 (file)
@@ -4028,10 +4028,7 @@ wimlib_resolve_image(WIMStruct *wim,
  * This also enables error messages, as if by a call to
  * wimlib_set_print_errors(true).
  *
- * @return 0 on success; a ::wimlib_error_code value on failure.
- *
- * @retval ::WIMLIB_ERR_UNSUPPORTED
- *     wimlib was compiled using the <c>--without-error-messages</c> option.
+ * @return 0
  */
 extern int
 wimlib_set_error_file(FILE *fp);
@@ -4049,8 +4046,6 @@ wimlib_set_error_file(FILE *fp);
  *
  * @retval ::WIMLIB_ERR_OPEN
  *     The file named by @p path could not be opened for appending.
- * @retval ::WIMLIB_ERR_UNSUPPORTED
- *     wimlib was compiled using the <c>--without-error-messages</c> option.
  */
 extern int
 wimlib_set_error_file_by_name(const wimlib_tchar *path);
@@ -4248,10 +4243,7 @@ wimlib_set_output_pack_compression_type(WIMStruct *wim,
  *     @c true if messages are to be printed; @c false if messages are not to
  *     be printed.
  *
- * @return 0 on success; a ::wimlib_error_code value on failure.
- *
- * @retval ::WIMLIB_ERR_UNSUPPORTED
- *     wimlib was compiled using the <c>--without-error-messages</c> option.
+ * @return 0
  */
 extern int
 wimlib_set_print_errors(bool show_messages);
index 5da01bf7972e2b88fc51954f1a31caafca12c8a8..5c8fe650846565eab7b40b47b4f3976c47e51ab4 100644 (file)
@@ -1,11 +1,7 @@
 #ifndef _WIMLIB_ASSERT_H
 #define _WIMLIB_ASSERT_H
 
-#ifdef ENABLE_ASSERTIONS
 #include <assert.h>
-#  define wimlib_assert(expr) assert(expr)
-#else
-#  define wimlib_assert(expr)
-#endif
+#define wimlib_assert(expr)    assert(expr)
 
 #endif /* _WIMLIB_ASSERT_H */
index 265e1362438a39c9238fe9d67657d65cf2d59f27..237ece5018b8c2de4ff3cd0af11635afd7e4e88b 100644 (file)
@@ -63,12 +63,10 @@ struct chunk_compressor {
 
 /* Functions that return implementations of the chunk_compressor interface.  */
 
-#ifdef ENABLE_MULTITHREADED_COMPRESSION
 int
 new_parallel_chunk_compressor(int out_ctype, u32 out_chunk_size,
                              unsigned num_threads, u64 max_memory,
                              struct chunk_compressor **compressor_ret);
-#endif
 
 int
 new_serial_chunk_compressor(int out_ctype, u32 out_chunk_size,
index 06222a06f03050fd4c16cdd798a01ec2561ed1c1..75b48c1b2da97bc913ecd80c6835a1fa6aeb9fd9 100644 (file)
@@ -13,7 +13,6 @@ dummy_tprintf(const tchar *format, ...)
        return 0;
 }
 
-#ifdef ENABLE_ERROR_MESSAGES
 extern void
 wimlib_error(const tchar *format, ...)
        _format_attribute(printf, 1, 2) _cold_attribute;
@@ -35,14 +34,6 @@ wimlib_warning_with_errno(const tchar *format, ...)
 #  define WARNING_WITH_ERRNO(format, ...)      wimlib_warning_with_errno(T(format), ## __VA_ARGS__)
 extern bool wimlib_print_errors;
 extern FILE *wimlib_error_file;
-#else /* ENABLE_ERROR_MESSAGES */
-#  define wimlib_print_errors 0
-#  define wimlib_error_file NULL
-#  define ERROR(format, ...)                   dummy_tprintf(T(format), ## __VA_ARGS__)
-#  define ERROR_WITH_ERRNO(format, ...)                dummy_tprintf(T(format), ## __VA_ARGS__)
-#  define WARNING(format, ...)                 dummy_tprintf(T(format), ## __VA_ARGS__)
-#  define WARNING_WITH_ERRNO(format, ...)      dummy_tprintf(T(format), ## __VA_ARGS__)
-#endif /* !ENABLE_ERROR_MESSAGES */
 
 extern void
 print_byte_field(const u8 *field, size_t len, FILE *out);
index 6aa635bf669803e1ec2500336a0ab163d0d44977..4c2959068e989aa286e008c8a8e4cf17e3170c03 100644 (file)
@@ -25,8 +25,6 @@
 #  include "config.h"
 #endif
 
-#ifdef ENABLE_MULTITHREADED_COMPRESSION
-
 #include <errno.h>
 #include <pthread.h>
 #include <stdlib.h>
@@ -515,5 +513,3 @@ err:
        parallel_chunk_compressor_destroy(&ctx->base);
        return ret;
 }
-
-#endif /* ENABLE_MULTITHREADED_COMPRESSION */
index cccb815f58373483f44c398bc7e4b851e3c4a6a5..22352f533829003f6ae92c166810c67ea644f125 100644 (file)
@@ -46,7 +46,6 @@
 #include "wimlib/util.h"
 #include "wimlib/win32.h"
 
-#ifdef ENABLE_ERROR_MESSAGES
 bool wimlib_print_errors = false;
 FILE *wimlib_error_file = NULL; /* Set in wimlib_global_init() */
 static bool wimlib_owns_error_file = false;
@@ -119,7 +118,6 @@ wimlib_warning_with_errno(const tchar *format, ...)
        wimlib_vmsg(T("\r[WARNING] "), format, va, true);
        va_end(va);
 }
-#endif /* ENABLE_ERROR_MESSAGES */
 
 void
 print_byte_field(const u8 *field, size_t len, FILE *out)
@@ -131,34 +129,24 @@ print_byte_field(const u8 *field, size_t len, FILE *out)
 WIMLIBAPI int
 wimlib_set_print_errors(bool show_error_messages)
 {
-#ifdef ENABLE_ERROR_MESSAGES
        wimlib_print_errors = show_error_messages;
-#else
-       if (show_error_messages)
-               return WIMLIB_ERR_UNSUPPORTED;
-#endif
        return 0;
 }
 
 WIMLIBAPI int
 wimlib_set_error_file(FILE *fp)
 {
-#ifdef ENABLE_ERROR_MESSAGES
        if (wimlib_owns_error_file)
                fclose(wimlib_error_file);
        wimlib_error_file = fp;
        wimlib_print_errors = (fp != NULL);
        wimlib_owns_error_file = false;
        return 0;
-#else
-       return WIMLIB_ERR_UNSUPPORTED;
-#endif
 }
 
 WIMLIBAPI int
 wimlib_set_error_file_by_name(const tchar *path)
 {
-#ifdef ENABLE_ERROR_MESSAGES
        FILE *fp;
 
 #ifdef __WIN32__
@@ -171,9 +159,6 @@ wimlib_set_error_file_by_name(const tchar *path)
        wimlib_set_error_file(fp);
        wimlib_owns_error_file = true;
        return 0;
-#else
-       return WIMLIB_ERR_UNSUPPORTED;
-#endif
 }
 
 static const tchar * const error_strings[] = {
index 8b6139ad4dbf65da2a0dc32a4c1043c59f90f667..dd0d2edd09cd2a7f83b1fa11c4149fc234d64b5f 100644 (file)
@@ -1034,7 +1034,6 @@ report_sha1_mismatch(struct blob_descriptor *blob,
                      blob_file_path(blob), expected_hashstr, actual_hashstr);
                return WIMLIB_ERR_CONCURRENT_MODIFICATION_DETECTED;
        } else if (blob->blob_location == BLOB_IN_WIM) {
-       #ifdef ENABLE_ERROR_MESSAGES
                const struct wim_resource_descriptor *rdesc = blob->rdesc;
 
                (recover_data ? wimlib_warning : wimlib_error)(
@@ -1060,7 +1059,6 @@ report_sha1_mismatch(struct blob_descriptor *blob,
                                                rdesc->compression_type),
                      rdesc->chunk_size,
                      expected_hashstr, actual_hashstr);
-       #endif /* ENABLE_ERROR_MESSAGES */
                if (recover_data)
                        return 0;
                return WIMLIB_ERR_INVALID_RESOURCE_HASH;
index ca40e53a47a303b4dbe3cb44e2172e2976e91da5..08b0c1c0e6df49be04f97da7afd2a570866a897c 100644 (file)
--- a/src/wim.c
+++ b/src/wim.c
@@ -958,10 +958,8 @@ wimlib_global_init(int init_flags)
        if (lib_initialized)
                goto out_unlock;
 
-#ifdef ENABLE_ERROR_MESSAGES
        if (!wimlib_error_file)
                wimlib_error_file = stderr;
-#endif
 
        ret = WIMLIB_ERR_INVALID_PARAM;
        if (init_flags & ~(WIMLIB_INIT_FLAG_ASSUME_UTF8 |
index e28069ebba707acd49ad53e5aae3c9ade3a01b8a..c2cbba5fc5f53b79a8ddc370d6a4796199b17f36 100644 (file)
@@ -1551,7 +1551,6 @@ write_blob_list(struct list_head *blob_list,
         * specified number of threads, unless the upper bound on the number
         * bytes needing to be compressed is less than a heuristic value.  */
        if (num_nonraw_bytes != 0 && out_ctype != WIMLIB_COMPRESSION_TYPE_NONE) {
-       #ifdef ENABLE_MULTITHREADED_COMPRESSION
                if (num_nonraw_bytes > max(2000000, out_chunk_size)) {
                        ret = new_parallel_chunk_compressor(out_ctype,
                                                            out_chunk_size,
@@ -1563,7 +1562,6 @@ write_blob_list(struct list_head *blob_list,
                                        wimlib_get_error_string(ret));
                        }
                }
-       #endif
 
                if (ctx.compressor == NULL) {
                        ret = new_serial_chunk_compressor(out_ctype, out_chunk_size,