summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_unit.h
diff options
context:
space:
mode:
authorAndrei Belov <defan@nginx.com>2020-04-16 18:27:26 +0300
committerAndrei Belov <defan@nginx.com>2020-04-16 18:27:26 +0300
commit74f32d26b91f49d3392605e81c1597b375890b60 (patch)
treeadfc67dfc86461441bde65512f745ce27bd6ea28 /src/nxt_unit.h
parent2ff9df10ef1df43c935c870175e52473dad2c21a (diff)
parent9877087756144d3bdf343d0d4e91e1efbcc62c93 (diff)
downloadunit-74f32d26b91f49d3392605e81c1597b375890b60.tar.gz
unit-74f32d26b91f49d3392605e81c1597b375890b60.tar.bz2
Merged with the default branch.1.17.0-1
Diffstat (limited to 'src/nxt_unit.h')
-rw-r--r--src/nxt_unit.h23
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)