diff --git a/evdns.h b/evdns.h index ee272d20..d502564d 100644 --- a/evdns.h +++ b/evdns.h @@ -237,6 +237,10 @@ #ifndef EVENTDNS_H #define EVENTDNS_H +#ifdef __cplusplus +extern "C" { +#endif + /* Error codes 0-5 are as described in RFC 1035. */ #define DNS_ERR_NONE 0 /* The name server was unable to interpret the query */ @@ -303,4 +307,8 @@ void evdns_set_log_fn(evdns_debug_log_fn_type fn); #define DNS_NO_SEARCH 1 +#ifdef __cplusplus +} +#endif + #endif // !EVENTDNS_H diff --git a/event.c b/event.c index 90f88ab6..f6d2b1cc 100644 --- a/event.c +++ b/event.c @@ -301,6 +301,8 @@ event_process_active(struct event_base *base) } } + assert(activeq != NULL); + for (ev = TAILQ_FIRST(activeq); ev; ev = TAILQ_FIRST(activeq)) { event_queue_remove(base, ev, EVLIST_ACTIVE);