* details.
*
* You should have received a copy of the GNU Lesser General Public License
- * along with this file; if not, see http://www.gnu.org/licenses/.
+ * along with this file; if not, see https://www.gnu.org/licenses/.
*/
#ifdef HAVE_CONFIG_H
#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;
T("unknown error (errno=%d)"),
errno_save);
}
- #ifdef WIN32
+ #ifdef _WIN32
if (errno_save == EBUSY)
tstrcpy(buf, T("Resource busy"));
#endif
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)
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__
+#ifdef _WIN32
fp = win32_open_logfile(path);
#else
fp = fopen(path, "a");
wimlib_set_error_file(fp);
wimlib_owns_error_file = true;
return 0;
-#else
- return WIMLIB_ERR_UNSUPPORTED;
-#endif
}
static const tchar * const error_strings[] = {