diff options
author | Max Romanov <max.romanov@nginx.com> | 2020-03-30 14:08:20 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2020-03-30 14:08:20 +0300 |
commit | 82b899b1365431951afc1da9b2b30065ac98fc94 (patch) | |
tree | 2f206a5e66616a6ad4459851a3f40c070d57630e /src/nxt_unit.h | |
parent | f94e31b294d69df40b59970ef4c721324cd3596e (diff) | |
download | unit-82b899b1365431951afc1da9b2b30065ac98fc94.tar.gz unit-82b899b1365431951afc1da9b2b30065ac98fc94.tar.bz2 |
Attributing libunit logging function for arguments validation.
Diffstat (limited to 'src/nxt_unit.h')
-rw-r--r-- | src/nxt_unit.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/nxt_unit.h b/src/nxt_unit.h index 900f3ac2..596dd8b6 100644 --- a/src/nxt_unit.h +++ b/src/nxt_unit.h @@ -356,10 +356,29 @@ int nxt_unit_websocket_retain(nxt_unit_websocket_frame_t *ws); void nxt_unit_websocket_done(nxt_unit_websocket_frame_t *ws); -void nxt_unit_log(nxt_unit_ctx_t *ctx, int level, const char* fmt, ...); +#if defined __has_attribute + +#if __has_attribute(format) + +#define NXT_ATTR_FORMAT __attribute__((format(printf, 3, 4))) + +#endif + +#endif + + +#if !defined(NXT_ATTR_FORMAT) + +#define NXT_ATTR_FORMAT + +#endif + + +void nxt_unit_log(nxt_unit_ctx_t *ctx, int level, const char* fmt, ...) + NXT_ATTR_FORMAT; void nxt_unit_req_log(nxt_unit_request_info_t *req, int level, - const char* fmt, ...); + const char* fmt, ...) NXT_ATTR_FORMAT; #if (NXT_DEBUG) |