From: Eric Biggers Date: Wed, 25 Dec 2013 07:03:56 +0000 (-0600) Subject: Remove --enable-more-debug and --disable-custom-memory-allocator options X-Git-Tag: v1.6.0~104 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=f37f269be1b81cdd00018db0486e377240093e75 Remove --enable-more-debug and --disable-custom-memory-allocator options The former was of little use due to the lack of DEBUG2() statements, and the latter barely saved any space and wasn't worth having an option for. --- diff --git a/configure.ac b/configure.ac index 5783d352..50a8e056 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ AC_INIT([wimlib], [1.5.3], [ebiggers3@gmail.com]) AC_CONFIG_SRCDIR([src/wim.c]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_AUX_DIR([build-aux]) -AM_INIT_AUTOMAKE([-Wall -Werror subdir-objects]) +AM_INIT_AUTOMAKE([-Wall -Werror subdir-objects foreign]) AC_C_BIGENDIAN m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) LT_INIT @@ -102,19 +102,6 @@ if test "x$ENABLE_DEBUG" = "xyes"; then [Define to 1 if including lots of debug messages.]) fi -AC_MSG_CHECKING([whether to include more debugging messages]) -AC_ARG_ENABLE([more_debug], - AS_HELP_STRING([--enable-more-debug], - [include even more debugging messages]), - [ENABLE_MORE_DEBUG=$enableval], - [ENABLE_MORE_DEBUG=no] - ) -AC_MSG_RESULT([$ENABLE_MORE_DEBUG]) -if test "x$ENABLE_MORE_DEBUG" = "xyes"; then - AC_DEFINE([ENABLE_MORE_DEBUG], [1], - [Define to 1 if including even more debug messages.]) -fi - AC_MSG_CHECKING([whether to include error messages]) AC_ARG_ENABLE([error_messages], AS_HELP_STRING([--disable-error-messages], @@ -128,20 +115,6 @@ if test "x$ENABLE_ERROR_MESSAGES" = "xyes"; then [Define to 1 if including error messages]) fi -AC_MSG_CHECKING([whether to support custom memory allocation functions]) -AC_ARG_ENABLE([custom_memory_allocator], - AS_HELP_STRING([--disable-custom-memory-allocator], - [do not support the use of custom memory allocation - functions]), - [ENABLE_CUSTOM_MEMORY_ALLOCATOR=$enableval], - [ENABLE_CUSTOM_MEMORY_ALLOCATOR=yes] - ) -AC_MSG_RESULT([$ENABLE_CUSTOM_MEMORY_ALLOCATOR]) -if test "x$ENABLE_CUSTOM_MEMORY_ALLOCATOR" = "xyes"; then - AC_DEFINE([ENABLE_CUSTOM_MEMORY_ALLOCATOR], [1], - [Define to 1 if supporting custom memory allocation functions]) -fi - AC_MSG_CHECKING([whether to include assertions]) AC_ARG_ENABLE([assertions], AS_HELP_STRING([--disable-assertions], [do not include assertions]), diff --git a/include/wimlib.h b/include/wimlib.h index 4a47ebac..2245a372 100644 --- a/include/wimlib.h +++ b/include/wimlib.h @@ -3359,10 +3359,7 @@ wimlib_set_image_name(WIMStruct *wim, int image, const wimlib_tchar *name); * A function equivalent to @c realloc() that wimlib will use to reallocate * memory. If @c NULL, the free function is set back to the default @c * realloc() from the C library. - * @return 0 on success; nonzero on error. - * @retval ::WIMLIB_ERR_UNSUPPORTED - * wimlib was compiled with the @c --without-custom-memory-allocator flag, - * so custom memory allocators are unsupported. + * @return 0 */ extern int wimlib_set_memory_allocator(void *(*malloc_func)(size_t), diff --git a/include/wimlib/error.h b/include/wimlib/error.h index 8d02120b..52226402 100644 --- a/include/wimlib/error.h +++ b/include/wimlib/error.h @@ -74,10 +74,4 @@ wimlib_debug(const tchar *file, int line, const char *func, # define DEBUG(format, ...) dummy_tprintf(T(format), ## __VA_ARGS__) #endif /* !ENABLE_DEBUG */ -#ifdef ENABLE_MORE_DEBUG -# define DEBUG2(format, ...) DEBUG(format, ## __VA_ARGS__) -#else -# define DEBUG2(format, ...) dummy_tprintf(T(format), ## __VA_ARGS__) -#endif /* !ENABLE_MORE_DEBUG */ - #endif /* _WIMLIB_ERROR_H */ diff --git a/include/wimlib/util.h b/include/wimlib/util.h index 8e9d695e..2f630d57 100644 --- a/include/wimlib/util.h +++ b/include/wimlib/util.h @@ -53,7 +53,6 @@ * places when large temporary buffers are needed). */ #define STACK_MAX 32768 -#ifdef ENABLE_CUSTOM_MEMORY_ALLOCATOR extern void * wimlib_malloc(size_t) _malloc_attribute; @@ -74,22 +73,12 @@ wimlib_wcsdup(const wchar_t *str) _malloc_attribute; extern char * wimlib_strdup(const char *str) _malloc_attribute; -# define MALLOC wimlib_malloc -# define FREE wimlib_free_memory -# define REALLOC wimlib_realloc -# define CALLOC wimlib_calloc -# define STRDUP wimlib_strdup -# define WCSDUP wimlib_wcsdup -#else /* ENABLE_CUSTOM_MEMORY_ALLOCATOR */ -# include -# include -# define MALLOC malloc -# define FREE free -# define REALLOC realloc -# define CALLOC calloc -# define STRDUP strdup -# define WCSDUP wcsdup -#endif /* !ENABLE_CUSTOM_MEMORY_ALLOCATOR */ +#define MALLOC wimlib_malloc +#define FREE wimlib_free_memory +#define REALLOC wimlib_realloc +#define CALLOC wimlib_calloc +#define STRDUP wimlib_strdup +#define WCSDUP wimlib_wcsdup extern void * memdup(const void *mem, size_t size) _malloc_attribute; diff --git a/include/wimlib/xml.h b/include/wimlib/xml.h index a4fd1152..e9c044af 100644 --- a/include/wimlib/xml.h +++ b/include/wimlib/xml.h @@ -60,11 +60,9 @@ libxml_global_init(void); extern void libxml_global_cleanup(void); -#ifdef ENABLE_CUSTOM_MEMORY_ALLOCATOR extern void xml_set_memory_allocator(void *(*malloc_func)(size_t), void (*free_func)(void *), void *(*realloc_func)(void *, size_t)); -#endif #endif diff --git a/src/capture_common.c b/src/capture_common.c index c45ae152..66f6411f 100644 --- a/src/capture_common.c +++ b/src/capture_common.c @@ -177,8 +177,8 @@ match_pattern(const tchar *path, string, pat); return true; } else { - DEBUG2("\"%"TS"\" does not match the pattern \"%"TS"\"", - string, pat); + DEBUG("\"%"TS"\" does not match the pattern \"%"TS"\"", + string, pat); } } return false; diff --git a/src/ntfs-3g_capture.c b/src/ntfs-3g_capture.c index 9bcdcc51..03c3282d 100644 --- a/src/ntfs-3g_capture.c +++ b/src/ntfs-3g_capture.c @@ -171,7 +171,7 @@ capture_ntfs_streams(struct wim_inode *inode, int ret; struct wim_lookup_table_entry *lte; - DEBUG2("Capturing NTFS data streams from `%s'", path); + DEBUG("Capturing NTFS data streams from `%s'", path); /* Get context to search the streams of the NTFS file. */ actx = ntfs_attr_get_search_ctx(ni, NULL); @@ -296,7 +296,7 @@ out_free_ntfs_loc: out_put_actx: ntfs_attr_put_search_ctx(actx); if (ret == 0) - DEBUG2("Successfully captured NTFS streams from \"%s\"", path); + DEBUG("Successfully captured NTFS streams from \"%s\"", path); else ERROR("Failed to capture NTFS streams from \"%s\"", path); return ret; diff --git a/src/util.c b/src/util.c index 728dae3f..27f01c41 100644 --- a/src/util.c +++ b/src/util.c @@ -438,7 +438,6 @@ wimlib_get_error_string(enum wimlib_error_code code) -#ifdef ENABLE_CUSTOM_MEMORY_ALLOCATOR static void *(*wimlib_malloc_func) (size_t) = malloc; static void (*wimlib_free_func) (void *) = free; static void *(*wimlib_realloc_func)(void *, size_t) = realloc; @@ -509,8 +508,6 @@ wimlib_wcsdup(const wchar_t *str) } #endif -#endif /* ENABLE_CUSTOM_MEMORY_ALLOCATOR */ - void * memdup(const void *mem, size_t size) { @@ -526,7 +523,6 @@ wimlib_set_memory_allocator(void *(*malloc_func)(size_t), void (*free_func)(void *), void *(*realloc_func)(void *, size_t)) { -#ifdef ENABLE_CUSTOM_MEMORY_ALLOCATOR wimlib_malloc_func = malloc_func ? malloc_func : malloc; wimlib_free_func = free_func ? free_func : free; wimlib_realloc_func = realloc_func ? realloc_func : realloc; @@ -534,12 +530,6 @@ wimlib_set_memory_allocator(void *(*malloc_func)(size_t), xml_set_memory_allocator(wimlib_malloc_func, wimlib_free_func, wimlib_realloc_func); return 0; -#else - ERROR("Cannot set custom memory allocator functions:"); - ERROR("wimlib was compiled with the --without-custom-memory-allocator " - "flag"); - return WIMLIB_ERR_UNSUPPORTED; -#endif } static bool seeded = false; diff --git a/src/xml.c b/src/xml.c index 542fc379..5103d75d 100644 --- a/src/xml.c +++ b/src/xml.c @@ -1092,7 +1092,6 @@ xml_get_max_image_name_len(const WIMStruct *wim) return max_len; } -#ifdef ENABLE_CUSTOM_MEMORY_ALLOCATOR void xml_set_memory_allocator(void *(*malloc_func)(size_t), void (*free_func)(void *), @@ -1100,7 +1099,6 @@ xml_set_memory_allocator(void *(*malloc_func)(size_t), { xmlMemSetup(free_func, malloc_func, realloc_func, STRDUP); } -#endif static int calculate_dentry_statistics(struct wim_dentry *dentry, void *arg)