mirror of https://github.com/getdnsapi/getdns.git
Portable with event1.x, test succeeds on FreeBSD
This commit is contained in:
parent
0761834cf5
commit
64c057b82d
|
@ -63,8 +63,7 @@ $(distdir):
|
|||
cp $(srcdir)/config.sub $(distdir)
|
||||
cp $(srcdir)/config.guess $(distdir)
|
||||
cp $(srcdir)/ltmain.sh $(distdir)
|
||||
cp $(srcdir)/src/Makefile.in $(distdir)/src
|
||||
cp $(srcdir)/src/Doxyfile.in $(distdir)/src
|
||||
cp $(srcdir)/src/*.in $(distdir)/src
|
||||
cp $(srcdir)/src/*.[ch] $(distdir)/src
|
||||
cp $(srcdir)/src/getdns/*.in $(distdir)/src/getdns
|
||||
cp $(srcdir)/src/getdns/*.h $(distdir)/src/getdns
|
||||
|
|
|
@ -141,7 +141,7 @@ if test -z "$DOXYGEN";
|
|||
fi
|
||||
|
||||
# Checks for header files.
|
||||
AC_CHECK_HEADERS([inttypes.h netinet/in.h stdint.h stdlib.h string.h])
|
||||
AC_CHECK_HEADERS([inttypes.h netinet/in.h stdint.h stdlib.h string.h event2/event.h])
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_HEADER_STDBOOL
|
||||
|
@ -155,4 +155,5 @@ AC_CONFIG_FILES([Makefile src/Makefile src/getdns/Makefile src/example/Makefile
|
|||
if [ test -n "$DOXYGEN" ]
|
||||
then AC_CONFIG_FILES([src/Doxyfile])
|
||||
fi
|
||||
AC_CONFIG_HEADER([src/config.h])
|
||||
AC_OUTPUT
|
||||
|
|
|
@ -28,9 +28,13 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#ifdef HAVE_EVENT2_EVENT_H
|
||||
# include <event2/event.h>
|
||||
#else
|
||||
# include <event.h>
|
||||
#endif
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include <event2/event.h>
|
||||
#include <ldns/ldns.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
|
|
|
@ -34,10 +34,18 @@
|
|||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#ifdef HAVE_EVENT2_EVENT_H
|
||||
# include <event2/event.h>
|
||||
#else
|
||||
# include <event.h>
|
||||
# define evutil_socket_t int
|
||||
# define event_free free
|
||||
# define evtimer_new(b, cb, arg) event_new((b), -1, 0, (cb), (arg))
|
||||
#endif
|
||||
#include <string.h>
|
||||
#include <unbound.h>
|
||||
#include <unbound-event.h>
|
||||
#include <event2/event.h>
|
||||
#include <ldns/ldns.h>
|
||||
#include "context.h"
|
||||
#include "types-internal.h"
|
||||
|
@ -67,6 +75,18 @@ typedef struct netreq_cb_data
|
|||
char *bogus;
|
||||
} netreq_cb_data;
|
||||
|
||||
#ifndef HAVE_EVENT2_EVENT_H
|
||||
static struct event *
|
||||
event_new(struct event_base *b, evutil_socket_t fd, short ev, void* cb, void *arg)
|
||||
{
|
||||
struct event* e = (struct event*)calloc(1, sizeof(struct event));
|
||||
if(!e) return NULL;
|
||||
event_set(e, fd, ev, cb, arg);
|
||||
event_base_set(b, e);
|
||||
return e;
|
||||
}
|
||||
#endif /* no event2 */
|
||||
|
||||
/* cancel, cleanup and send timeout to callback */
|
||||
static void
|
||||
ub_resolve_timeout(evutil_socket_t fd, short what, void *arg)
|
||||
|
|
|
@ -33,10 +33,16 @@
|
|||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#ifdef HAVE_EVENT2_EVENT_H
|
||||
# include <event2/event.h>
|
||||
#else
|
||||
# include <event.h>
|
||||
# define event_free free
|
||||
#endif
|
||||
#include "types-internal.h"
|
||||
#include "util-internal.h"
|
||||
#include <unbound.h>
|
||||
#include <event2/event.h>
|
||||
|
||||
/* useful macros */
|
||||
#define gd_malloc(sz) context->malloc(sz)
|
||||
|
|
|
@ -33,8 +33,13 @@
|
|||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#ifdef HAVE_EVENT2_EVENT_H
|
||||
# include <event2/event.h>
|
||||
#else
|
||||
# include <event.h>
|
||||
#endif
|
||||
#include <getdns/getdns.h>
|
||||
#include <event2/event.h>
|
||||
#include <unbound-event.h>
|
||||
#include "context.h"
|
||||
#include "general.h"
|
||||
|
|
|
@ -26,12 +26,17 @@
|
|||
* THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#ifdef HAVE_EVENT2_EVENT_H
|
||||
# include <event2/event.h>
|
||||
#else
|
||||
# include <event.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "testmessages.h"
|
||||
#include <getdns/getdns.h>
|
||||
#include <event2/event.h>
|
||||
|
||||
/* Set up the callback function, which will also do the processing of the results */
|
||||
void
|
||||
|
|
Loading…
Reference in New Issue