summaryrefslogtreecommitdiff
path: root/src/feature/control
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2020-01-10 08:55:18 -0500
committerNick Mathewson <nickm@torproject.org>2020-02-06 14:33:05 -0500
commit98fdc3e41a79625a5f4b51689a7c76fed4228d00 (patch)
treebb41e1179179c5c483aafed3c1bf7803f4e32ef4 /src/feature/control
parent8d6f27cea58627e08e7872c785456235122e060b (diff)
downloadtor-98fdc3e41a79625a5f4b51689a7c76fed4228d00.tar.gz
tor-98fdc3e41a79625a5f4b51689a7c76fed4228d00.zip
Use a compile-time assert in control_events.h
(The original idiom here led clang-format to generating a too-wide line.)
Diffstat (limited to 'src/feature/control')
-rw-r--r--src/feature/control/control_events.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/feature/control/control_events.h b/src/feature/control/control_events.h
index 74bbc0047d..535c8e5887 100644
--- a/src/feature/control/control_events.h
+++ b/src/feature/control/control_events.h
@@ -12,6 +12,7 @@
#ifndef TOR_CONTROL_EVENTS_H
#define TOR_CONTROL_EVENTS_H
+#include "lib/cc/ctassert.h"
#include "core/or/ocirc_event.h"
#include "core/or/orconn_event.h"
@@ -287,10 +288,7 @@ typedef uint64_t event_mask_t;
/* If EVENT_MAX_ ever hits 0x0040, we need to make the mask into a
* different structure, as it can only handle a maximum left shift of 1<<63. */
-
-#if EVENT_MAX_ >= EVENT_CAPACITY_
-#error control_connection_t.event_mask has an event greater than its capacity
-#endif
+CTASSERT(EVENT_MAX_ < EVENT_CAPACITY_);
#define EVENT_MASK_(e) (((uint64_t)1)<<(e))