From 5998a2c035e90aa01d97da26b9ef2b2b503f3d83 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sun, 23 May 2010 14:37:19 +0200 Subject: fixed error handling on Unix --- src/errors.c | 7 +++++-- tests/log/test_log.c | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/errors.c b/src/errors.c index a453dbe..9914b51 100644 --- a/src/errors.c +++ b/src/errors.c @@ -15,14 +15,17 @@ along with this program. If not, see . */ +#include "port/string.h" /* for strncpy, strerror_r */ #include "errors.h" #include "port/gettext.h" /* for localization */ -#include "port/string.h" /* for strncpy, strerror_r */ + #if defined _WIN32 #define WIN32_MEAN_AND_LEAN -#include +#include /* for GetLastError */ +#else +#include /* for errno */ #endif /* defined _WIN32 */ char *wolf_error_msg( const wolf_error_t error, char *buf, size_t buflen ) { diff --git a/tests/log/test_log.c b/tests/log/test_log.c index 50a3904..e1486d8 100644 --- a/tests/log/test_log.c +++ b/tests/log/test_log.c @@ -18,6 +18,7 @@ #include "log/log.h" /* for logging */ #include "log/messages.h" /* for i18n */ #include "port/string.h" /* for strerror_r */ +#include "errors.h" #include /* for exit, EXIT_SUCCESS, free */ #include /* for errno */ -- cgit v1.2.3-54-g00ecf