[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/master] Make voting_schedule.h work correctly when dirauth-mode is disabled.
commit 1b66b39699e31adb3f10717e5bd252f294f7636f
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
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) */
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits