From 00ea402050da45943b1cf1c11d7ac4e1ddbfa489 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Thu, 31 Aug 2017 09:28:30 +0100 Subject: Don't stomp on 'ctx' in logging macro --- include/nslog/nslog.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/nslog/nslog.h b/include/nslog/nslog.h index 045914c..0288f5d 100644 --- a/include/nslog/nslog.h +++ b/include/nslog/nslog.h @@ -173,7 +173,7 @@ typedef struct nslog_entry_context_s { #define NSLOG(catname, level, logmsg, args...) \ do { \ if (NSLOG_LEVEL_##level >= NSLOG_COMPILED_MIN_LEVEL) { \ - static nslog_entry_context_t ctx = { \ + static nslog_entry_context_t _nslog_ctx = { \ &__nslog_category_##catname, \ NSLOG_LEVEL_##level, \ __FILE__, \ @@ -182,7 +182,7 @@ typedef struct nslog_entry_context_s { sizeof(__PRETTY_FUNCTION__) - 1, \ __LINE__, \ }; \ - nslog__log(&ctx, logmsg, ##args); \ + nslog__log(&_nslog_ctx, logmsg, ##args); \ } \ } while(0) -- cgit v1.2.3