summaryrefslogtreecommitdiff
path: root/src/first.h
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2019-03-19 23:49:03 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2019-04-20 02:10:28 -0400
commit9eead7db7c0638c901cc7af522757181549d5d7f (patch)
tree0d490f9e0f5e4d911ae430886ea472a4d22e5b63 /src/first.h
parent0dccda28adfece833c3a8f4b6b21fddfc07ad04c (diff)
downloadlighttpd-git-9eead7db7c0638c901cc7af522757181549d5d7f.tar.gz
[core] __attribute__((format ...))
Diffstat (limited to 'src/first.h')
-rw-r--r--src/first.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/first.h b/src/first.h
index 044d7e1f..caa19c14 100644
--- a/src/first.h
+++ b/src/first.h
@@ -111,11 +111,22 @@
#endif
#endif
+#ifndef __attribute_fallthrough__
#if __has_attribute(fallthrough) \
|| __GNUC_PREREQ(7,0)
#define __attribute_fallthrough__ __attribute__((__fallthrough__));
#else
-#define __attribute_fallthrough__
+#define __attribute_fallthrough__ /* fall through */
+#endif
+#endif
+
+#ifndef __attribute_format__
+#if __has_attribute(format) \
+ || __GNUC_PREREQ(2,95) /*(maybe earlier gcc, too)*/
+#define __attribute_format__(x) __attribute__((__format__ x))
+#else
+#define __attribute_format__(x)
+#endif
#endif