-extern bool __wimlib_print_errors;
-extern void wimlib_error(const char *format, ...)
- FORMAT(printf, 1, 2) COLD;
-extern void wimlib_warning(const char *format, ...)
- FORMAT(printf, 1, 2) COLD;
-# define ERROR wimlib_error
-# define WARNING wimlib_warning
-#else
-# define ERROR(format, ...)
-# define WARNING(format, ...)
-#endif /* ENABLE_ERROR_MESSAGES */
+extern void
+wimlib_error(const char *format, ...) FORMAT(printf, 1, 2) COLD;
+
+extern void
+wimlib_error_with_errno(const char *format, ...) FORMAT(printf, 1, 2) COLD;
+
+extern void
+wimlib_warning(const char *format, ...) FORMAT(printf, 1, 2) COLD;
+
+extern void
+wimlib_warning_with_errno(const char *format, ...) FORMAT(printf, 1, 2) COLD;
+# define ERROR wimlib_error
+# define ERROR_WITH_ERRNO wimlib_error_with_errno
+# define WARNING wimlib_warning
+# define WARNING_WITH_ERRNO wimlib_warning
+#else /* ENABLE_ERROR_MESSAGES */
+# define ERROR(format, ...) dummy_printf(format, ## __VA_ARGS__)
+# define ERROR_WITH_ERRNO(format, ...) dummy_printf(format, ## __VA_ARGS__)
+# define WARNING(format, ...) dummy_printf(format, ## __VA_ARGS__)
+# define WARNING_WITH_ERRNO(format, ...) dummy_printf(format, ## __VA_ARGS__)
+#endif /* !ENABLE_ERROR_MESSAGES */