Skip to content

Commit

Permalink
Pass module as %s arg instead of concatenation
Browse files Browse the repository at this point in the history
  • Loading branch information
07151129 committed Jan 9, 2020
1 parent d43a05f commit de7cc8d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Lilu Changelog
- Made applyLookupPatch support kernel patches by passsing null kext
- Export hde64 interface
- Added evector deleter without copying for improved performance
- Allow C strings as module prefix argument to the logging functions

#### v1.4.0
- Fixed mishandling user patches process list after processKernel API call
Expand Down
32 changes: 16 additions & 16 deletions Lilu/Headers/kern_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ extern proc_t kernproc;
* @param cond precondition
* @param str printf-like string
*/
#define SYSLOG_COND(cond, module, str, ...) \
do { \
if (cond) \
lilu_os_log( "%s%10s" str "\n", xStringify(PRODUCT_NAME) ": ", module " @ ", ## __VA_ARGS__); \
#define SYSLOG_COND(cond, module, str, ...) \
do { \
if (cond) \
lilu_os_log( "%s%10s: @ " str "\n", xStringify(PRODUCT_NAME), safeString(module), ## __VA_ARGS__); \
} while (0)

/**
Expand All @@ -94,12 +94,12 @@ extern proc_t kernproc;
* @param module log module
* @param str printf-like string
*/
#define SYSTRACE_COND(cond, module, str, ...) \
do { \
if (cond) { \
SYSLOG(module, str, ## __VA_ARGS__); \
OSReportWithBacktrace( "%s%10s" str "\n", xStringify(PRODUCT_NAME) ": ", module " @ ", ## __VA_ARGS__); \
} \
#define SYSTRACE_COND(cond, module, str, ...) \
do { \
if (cond) { \
SYSLOG(module, str, ## __VA_ARGS__); \
OSReportWithBacktrace( "%s%10s: @ " str "\n", xStringify(PRODUCT_NAME), safeString(module), ## __VA_ARGS__); \
} \
} while (0)

/**
Expand All @@ -117,12 +117,12 @@ extern proc_t kernproc;
* @param module log module
* @param str printf-like string
*/
#define PANIC_COND(cond, module, str, ...) \
do { \
if (cond) { \
(panic)( "%s%10s" str "\n", xStringify(PRODUCT_NAME) ": ", module " @ ", ## __VA_ARGS__); \
UNREACHABLE(); \
} \
#define PANIC_COND(cond, module, str, ...) \
do { \
if (cond) { \
(panic)( "%s%10s: @ " str "\n", xStringify(PRODUCT_NAME), safeString(module), ## __VA_ARGS__); \
UNREACHABLE(); \
} \
} while (0)

/**
Expand Down

0 comments on commit de7cc8d

Please sign in to comment.