X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=include%2Fwimlib%2Ferror.h;h=45e8f14ff8bf5c7164a44324270ae7c3f1a17592;hb=a4204528d3fbd8b959025b897493cf68d5cbfc0f;hp=24f09de97633b69d79ab90274af9373c6c7abf02;hpb=affa6147e5c4c72bb22778368743e7203ea8fd79;p=wimlib diff --git a/include/wimlib/error.h b/include/wimlib/error.h index 24f09de9..45e8f14f 100644 --- a/include/wimlib/error.h +++ b/include/wimlib/error.h @@ -1,24 +1,12 @@ #ifndef _WIMLIB_ERROR_H #define _WIMLIB_ERROR_H +#include + #include "wimlib.h" /* Get error code definitions */ #include "wimlib/compiler.h" #include "wimlib/types.h" -#include - -#ifdef __WIN32__ -# define wimlib_fprintf fwprintf -# define wimlib_printf wprintf -#else /* __WIN32__ */ -extern int -wimlib_fprintf(FILE *fp, const tchar *format, ...) _format_attribute(printf, 2, 3); - -extern int -wimlib_printf(const tchar *format, ...) _format_attribute(printf, 1, 2); -#endif /* !__WIN32__ */ - - static inline int _format_attribute(printf, 1, 2) dummy_tprintf(const tchar *format, ...) { @@ -46,23 +34,16 @@ wimlib_warning_with_errno(const tchar *format, ...) # define WARNING(format, ...) wimlib_warning(T(format), ## __VA_ARGS__) # 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 */ -#if defined(ENABLE_MORE_DEBUG) && !defined(ENABLE_DEBUG) -# define ENABLE_DEBUG 1 -#endif - -#if defined(ENABLE_MORE_ASSERTIONS) && !defined(ENABLE_ASSERTIONS) -# define ENABLE_ASSERTIONS 1 -#endif - - #ifdef ENABLE_DEBUG extern void wimlib_debug(const tchar *file, int line, const char *func, @@ -74,4 +55,7 @@ wimlib_debug(const tchar *file, int line, const char *func, # define DEBUG(format, ...) dummy_tprintf(T(format), ## __VA_ARGS__) #endif /* !ENABLE_DEBUG */ +extern void +print_byte_field(const u8 *field, size_t len, FILE *out); + #endif /* _WIMLIB_ERROR_H */