summaryrefslogtreecommitdiff
path: root/protocols/Tox/libtox/src/toxcore/attributes.h
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-07-24 16:44:24 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-07-24 16:44:24 +0300
commite55d071e5485a937efd427d159b76c208cccdcce (patch)
tree48d09dc5cf1df2581fd6471b5ccf1560015fa3a4 /protocols/Tox/libtox/src/toxcore/attributes.h
parentf36629f67153bc500c828cf51de31988122a1024 (diff)
fixes #3118 (Update toxcore to 0.2.18)
Diffstat (limited to 'protocols/Tox/libtox/src/toxcore/attributes.h')
-rw-r--r--protocols/Tox/libtox/src/toxcore/attributes.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/protocols/Tox/libtox/src/toxcore/attributes.h b/protocols/Tox/libtox/src/toxcore/attributes.h
new file mode 100644
index 0000000000..3da768f2a3
--- /dev/null
+++ b/protocols/Tox/libtox/src/toxcore/attributes.h
@@ -0,0 +1,31 @@
+/* SPDX-License-Identifier: GPL-3.0-or-later
+ * Copyright © 2022 The TokTok team.
+ */
+
+/**
+ * printf and nonnull attributes for GCC/Clang and Cimple.
+ */
+#ifndef C_TOXCORE_TOXCORE_ATTRIBUTES_H
+#define C_TOXCORE_TOXCORE_ATTRIBUTES_H
+
+/* No declarations here. */
+
+//!TOKSTYLE-
+
+#ifdef __GNUC__
+#define GNU_PRINTF(f, a) __attribute__((__format__(__printf__, f, a)))
+#else
+#define GNU_PRINTF(f, a)
+#endif
+
+#if defined(__GNUC__) && defined(_DEBUG) && !defined(__OPTIMIZE__)
+#define non_null(...) __attribute__((__nonnull__(__VA_ARGS__)))
+#else
+#define non_null(...)
+#endif
+
+#define nullable(...)
+
+//!TOKSTYLE+
+
+#endif // C_TOXCORE_TOXCORE_ATTRIBUTES_H