Skip to content

Commit

Permalink
Log: Do not pollute namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
carstene1ns committed Mar 28, 2024
1 parent 5ac37b8 commit d08a45f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/io/log.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ enum {
LL_FATAL
};

// Let the compiler help with parameter formats
/* Let the compiler help with parameter formats
* (arguments are shifted by 1, because of hidden "this" pointer)
*/
#ifdef __GNUG__
#define LIKE_PRINTF __attribute__((format(printf, 5, 6)))
#else
Expand Down Expand Up @@ -80,4 +82,6 @@ EXTERN Log logger;
#define LOG_ERROR(...) logger.log(LL_ERROR, __FILE__, __LINE__, __VA_ARGS__)
#define LOG_FATAL(...) logger.log(LL_FATAL, __FILE__, __LINE__, __VA_ARGS__)

#undef LIKE_PRINTF

#endif

0 comments on commit d08a45f

Please sign in to comment.