summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndreas Baumann <abaumann@yahoo.com>2009-03-25 10:39:02 +0100
committerAndreas Baumann <abaumann@yahoo.com>2009-03-25 10:39:02 +0100
commit97ab7b1acf1dcbc5f1fff1a279949ef0919e1b78 (patch)
tree976be2e6a8d394682403cb3345ff07c7414ad8f9 /include
parentd5a0d432b679f0c4a8cc0a74d766ba03a008f7d9 (diff)
downloadwolfbones-97ab7b1acf1dcbc5f1fff1a279949ef0919e1b78.tar.gz
wolfbones-97ab7b1acf1dcbc5f1fff1a279949ef0919e1b78.tar.bz2
fixed logging macro on Windows
Diffstat (limited to 'include')
-rw-r--r--include/wolf/log/log.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/include/wolf/log/log.h b/include/wolf/log/log.h
index b31243b..ae91de2 100644
--- a/include/wolf/log/log.h
+++ b/include/wolf/log/log.h
@@ -288,9 +288,9 @@ void wolf_log_reopenlogtoeventlog( void );
void wolf_log( wolf_log_level_t level, int category_id, int message_id, const char *format, ... );
#ifdef _WIN32
-#define WOLF_LOG_GET_LAST_ERROR( errbuf, errbuf_size ) \
+
+#define WOLF_LOG_GET_LAST_ERROR( last_error, errbuf, errbuf_size ) \
{ \
- DWORD wolf_log_last_error = GetLastError( ); \
LPVOID wolf_log_errbuf; \
DWORD wolf_log_buf_size; \
DWORD wolf_log_res; \
@@ -301,14 +301,14 @@ void wolf_log( wolf_log_level_t level, int category_id, int message_id, const ch
FORMAT_MESSAGE_IGNORE_INSERTS | \
FORMAT_MESSAGE_MAX_WIDTH_MASK, \
NULL, /* message is from system */ \
- wolf_log_last_error, /* there is a message with that id */ \
+ last_error, /* there is a message with that id */ \
0, /* default language preference */ \
- (LPTSTR)&wolf_log_errbuf,/* buffer allocated internally with LocalAlloc */\
+ (LPTSTR)&wolf_log_errbuf,/* buffer allocated internally with LocalAlloc */ \
0, /* minimum allocation size */ \
NULL ); /* no arguments */ \
\
if( wolf_log_res == 0 ) { \
- strlcpy( wolf_log_errbuf, _( "No message available" ) \
+ strlcpy( errbuf, _( "No message available" ), errbuf_size ); \
} \
\
strlcpy( errbuf, wolf_log_errbuf, errbuf_size ); \