summaryrefslogtreecommitdiff
path: root/scripts/coccinelle
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-09-11 18:45:52 -0400
committerNick Mathewson <nickm@torproject.org>2019-09-11 18:45:52 -0400
commit25ed698fb8a4f438c2fc804cdb2b0bf92e641f59 (patch)
tree775b8df321652ce57d7ea22cd5bd6e3cfaa288dc /scripts/coccinelle
parentc6191983e93fc9d377650555fb78649e9fe8713b (diff)
downloadtor-25ed698fb8a4f438c2fc804cdb2b0bf92e641f59.tar.gz
tor-25ed698fb8a4f438c2fc804cdb2b0bf92e641f59.zip
Add some more of our trickier macros to tor-coccinelle.h
Note that this header file behaves a bit strangely. It is used by coccinelle just for the purpose of knowing how to parse difficult-to-parse stuff. It doesn't need to produce good C -- just grammatical C.
Diffstat (limited to 'scripts/coccinelle')
-rw-r--r--scripts/coccinelle/tor-coccinelle.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/scripts/coccinelle/tor-coccinelle.h b/scripts/coccinelle/tor-coccinelle.h
index 8f625dcee4..a94c3ef679 100644
--- a/scripts/coccinelle/tor-coccinelle.h
+++ b/scripts/coccinelle/tor-coccinelle.h
@@ -1,3 +1,21 @@
#define MOCK_IMPL(a, b, c) a b c
#define CHECK_PRINTF(a, b)
#define STATIC static
+
+#define STMT_BEGIN do {
+#define STMT_END } while (0)
+
+#define BUG(x) (x)
+#define IF_BUG_ONCE(x) if (x)
+
+#define ATTR_NORETURN
+#define ATTR_UNUSED
+#define ATTR_CONST
+#define ATTR_MALLOC
+#define ATTR_WUR
+
+#define HT_ENTRY(x) void *
+#define HT_HEAD(a,b) struct ht_head
+#define HT_INITIALIZER { }
+#define X509 struct x509_st
+#define STACK_OF(x) struct foo_stack_t