summaryrefslogtreecommitdiff
path: root/include/qntan/Log.h
diff options
context:
space:
mode:
authorhiddenalpha.ch2026-10-03 23:28:03 +0200
committerhiddenalpha.ch2026-10-03 23:28:03 +0200
commit921dee8691bfd7386860db93985b3b16f010f2e9 (patch)
treed10b3bbdca191d974548416e3d0dcf63e20fed7f /include/qntan/Log.h
parente2e26425a1d956bccef1aeb5c1bf8773efbbd6cf (diff)
downloadQntan-921dee8691bfd7386860db93985b3b16f010f2e9.tar.gz
Qntan-921dee8691bfd7386860db93985b3b16f010f2e9.zip
cleanup, add do{}while() wrap around LOG_ macros
Diffstat (limited to 'include/qntan/Log.h')
-rw-r--r--include/qntan/Log.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/qntan/Log.h b/include/qntan/Log.h
index 4b8efe6..a41c268 100644
--- a/include/qntan/Log.h
+++ b/include/qntan/Log.h
@@ -8,28 +8,28 @@ extern "C" {
#ifndef LOGF
-# define LOGF(A, ...) if(A) (*(A))->fatal(A, __VA_ARGS__)
+# define LOGF(A, ...) do{ if(A) (*(A))->fatal(A, __VA_ARGS__); }while(0)
#endif
#ifndef LOGE
-# define LOGE(A, ...) if(A) (*(A))->error(A, __VA_ARGS__)
+# define LOGE(A, ...) do{ if(A) (*(A))->error(A, __VA_ARGS__); }while(0)
#endif
#ifndef LOGW
-# define LOGW(A, ...) if(A) (*(A))->warn(A, __VA_ARGS__)
+# define LOGW(A, ...) do{ if(A) (*(A))->warn(A, __VA_ARGS__); }while(0)
#endif
#ifndef LOGI
-# define LOGI(A, ...) if(A) (*(A))->info(A, __VA_ARGS__)
+# define LOGI(A, ...) do{ if(A) (*(A))->info(A, __VA_ARGS__); }while(0)
#endif
#ifndef LOGD
-# define LOGD(A, ...) if(A) (*(A))->debug(A, __VA_ARGS__)
+# define LOGD(A, ...) do{ if(A) (*(A))->debug(A, __VA_ARGS__); }while(0)
#endif
#ifndef LOGT
# if !NDEBUG
-# define LOGT(A, ...) if(A) (*(A))->trace(A, __VA_ARGS__)
+# define LOGT(A, ...) do{ if(A) (*(A))->trace(A, __VA_ARGS__); }while(0)
# else
# define LOGT(A, ...) /*optimized away*/
# endif