aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/log.h
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-06-13 19:51:00 +0200
committerEgor Tensin <egor@tensin.name>2026-06-13 19:51:04 +0200
commit84262d9f69aa6730c69f464b5b4fb7f6030bf329 (patch)
tree44a506c7c10923e32ab2063594ec4049b988e97a /src/log.h
parentadd .git-blame-ignore-revs (diff)
downloadcimple-84262d9f69aa6730c69f464b5b4fb7f6030bf329.tar.gz
cimple-84262d9f69aa6730c69f464b5b4fb7f6030bf329.zip
switch from tabs to spaces
It was fun while it lasted, but I do believe that spaces are strictly superior, and clang-format struggles with tabs while using advanced configuration options.
Diffstat (limited to 'src/log.h')
-rw-r--r--src/log.h102
1 files changed, 51 insertions, 51 deletions
diff --git a/src/log.h b/src/log.h
index 6c0c517..c90516c 100644
--- a/src/log.h
+++ b/src/log.h
@@ -23,64 +23,64 @@ extern int g_log_lvl;
int log_entry_start(int lvl, FILE* dest);
void log_entry_end(FILE* dest);
-#define log_debug(...) \
- do { \
- if (!log_entry_start(LOG_LVL_DEBUG, stdout)) \
- break; \
- fprintf(stdout, __VA_ARGS__); \
- log_entry_end(stdout); \
- } while (0)
+#define log_debug(...) \
+ do { \
+ if (!log_entry_start(LOG_LVL_DEBUG, stdout)) \
+ break; \
+ fprintf(stdout, __VA_ARGS__); \
+ log_entry_end(stdout); \
+ } while (0)
-#define log(...) \
- do { \
- if (!log_entry_start(LOG_LVL_INFO, stdout)) \
- break; \
- fprintf(stdout, __VA_ARGS__); \
- log_entry_end(stdout); \
- } while (0)
+#define log(...) \
+ do { \
+ if (!log_entry_start(LOG_LVL_INFO, stdout)) \
+ break; \
+ fprintf(stdout, __VA_ARGS__); \
+ log_entry_end(stdout); \
+ } while (0)
-#define _log_err_file_loc() \
- do { \
- fprintf(stderr, "%s(%d): ", basename(__FILE__), __LINE__); \
- } while (0)
+#define _log_err_file_loc() \
+ do { \
+ fprintf(stderr, "%s(%d): ", basename(__FILE__), __LINE__); \
+ } while (0)
-#define log_err(...) \
- do { \
- if (!log_entry_start(LOG_LVL_ERR, stderr)) \
- break; \
- _log_err_file_loc(); \
- fprintf(stderr, __VA_ARGS__); \
- log_entry_end(stderr); \
- } while (0)
+#define log_err(...) \
+ do { \
+ if (!log_entry_start(LOG_LVL_ERR, stderr)) \
+ break; \
+ _log_err_file_loc(); \
+ fprintf(stderr, __VA_ARGS__); \
+ log_entry_end(stderr); \
+ } while (0)
-#define log_errno(fn) \
- do { \
- if (!log_entry_start(LOG_LVL_ERR, stderr)) \
- break; \
- _log_err_file_loc(); \
- perror(fn); \
- log_entry_end(stderr); \
- } while (0)
+#define log_errno(fn) \
+ do { \
+ if (!log_entry_start(LOG_LVL_ERR, stderr)) \
+ break; \
+ _log_err_file_loc(); \
+ perror(fn); \
+ log_entry_end(stderr); \
+ } while (0)
-#define log_errno_if(expr, fn) \
- do { \
- int CONCAT(ret, __LINE__) = expr; \
- if (CONCAT(ret, __LINE__) < 0) \
- log_errno(fn); \
- } while (0)
+#define log_errno_if(expr, fn) \
+ do { \
+ int CONCAT(ret, __LINE__) = expr; \
+ if (CONCAT(ret, __LINE__) < 0) \
+ log_errno(fn); \
+ } while (0)
#define pthread_errno(var, fn) \
- do { \
- errno = var; \
- log_errno(fn); \
- var = -var; \
- } while (0)
+ do { \
+ errno = var; \
+ log_errno(fn); \
+ var = -var; \
+ } while (0)
-#define pthread_errno_if(expr, fn) \
- do { \
- int CONCAT(ret, __LINE__) = expr; \
- if (CONCAT(ret, __LINE__)) \
- pthread_errno(CONCAT(ret, __LINE__), fn); \
- } while (0)
+#define pthread_errno_if(expr, fn) \
+ do { \
+ int CONCAT(ret, __LINE__) = expr; \
+ if (CONCAT(ret, __LINE__)) \
+ pthread_errno(CONCAT(ret, __LINE__), fn); \
+ } while (0)
#endif