[tor-commits] [tor/master] Make voting_schedule.h work correctly when dirauth-mode is disabled.
asn at torproject.org
asn at torproject.org
Tue Mar 3 12:36:53 UTC 2020
commit 1b66b39699e31adb3f10717e5bd252f294f7636f
Author: Nick Mathewson <nickm at torproject.org>
Date: Mon Feb 24 11:56:55 2020 -0500
Make voting_schedule.h work correctly when dirauth-mode is disabled.
---
src/feature/dirauth/voting_schedule.h | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/src/feature/dirauth/voting_schedule.h b/src/feature/dirauth/voting_schedule.h
index 5472719b2..9e2ac29c7 100644
--- a/src/feature/dirauth/voting_schedule.h
+++ b/src/feature/dirauth/voting_schedule.h
@@ -11,6 +11,8 @@
#include "core/or/or.h"
+#ifdef HAVE_MODULE_DIRAUTH
+
/** Scheduling information for a voting interval. */
typedef struct {
/** When do we generate and distribute our vote for this interval? */
@@ -63,4 +65,29 @@ time_t dirauth_sched_get_next_valid_after_time(void);
time_t dirauth_sched_get_cur_valid_after_time(void);
int dirauth_sched_get_configured_interval(void);
+#else /* !defined(HAVE_MODULE_DIRAUTH) */
+
+#define dirauth_sched_recalculate_timing(opt,now) \
+ ((void)(opt), (void)(now))
+
+static inline time_t
+dirauth_sched_get_next_valid_after_time(void)
+{
+ tor_assert_unreached();
+ return 0;
+}
+static inline time_t
+dirauth_sched_get_cur_valid_after_time(void)
+{
+ tor_assert_unreached();
+ return 0;
+}
+static inline int
+dirauth_sched_get_configured_interval(void)
+{
+ tor_assert_unreached();
+ return 1;
+}
+#endif /* defined(HAVE_MODULE_DIRAUTH) */
+
#endif /* !defined(TOR_VOTING_SCHEDULE_H) */
More information about the tor-commits
mailing list