diff --git a/lib/lwres/compat.c b/lib/lwres/compat.c index 84d3208c0a..b8ae31f196 100644 --- a/lib/lwres/compat.c +++ b/lib/lwres/compat.c @@ -49,15 +49,14 @@ static char sccsid[] = "@(#)strtoul.c 8.1 (Berkeley) 6/4/93"; #endif /* LIBC_SCCS and not lint */ -/* $Id: strtoul.c,v 1.4 2007/06/19 23:47:22 tbox Exp $ */ - #include #include #include #include -#include +#include +#include #define DE_CONST(konst, var) \ do { \ diff --git a/lib/lwres/getaddrinfo.c b/lib/lwres/getaddrinfo.c index be1f09aafb..133f0c1f9e 100644 --- a/lib/lwres/getaddrinfo.c +++ b/lib/lwres/getaddrinfo.c @@ -136,10 +136,11 @@ #include #include -#include #include #include #include +#include +#include #define SA(addr) ((struct sockaddr *)(addr)) #define SIN(addr) ((struct sockaddr_in *)(addr)) diff --git a/lib/lwres/include/lwres/compat.h b/lib/lwres/include/lwres/stdlib.h similarity index 84% rename from lib/lwres/include/lwres/compat.h rename to lib/lwres/include/lwres/stdlib.h index 19a9372166..4ee1dd2dac 100644 --- a/lib/lwres/include/lwres/compat.h +++ b/lib/lwres/include/lwres/stdlib.h @@ -15,10 +15,10 @@ * PERFORMANCE OF THIS SOFTWARE. */ -#ifndef LWRES_COMPAT_H -#define LWRES_COMPAT_H 1 +#ifndef LWRES_STDLIB_H +#define LWRES_STDLIB_H 1 -/*! \file lwres/compat.h */ +/*! \file lwres/stdlib.h */ #include @@ -29,14 +29,9 @@ #define strtoul lwres_strtoul #endif -#ifdef LWRES_PLATFORM_NEEDSTRLCPY -#define strlcpy lwres_strlcpy -#endif - LWRES_LANG_BEGINDECLS unsigned long lwres_strtoul(const char *, char **, int); -size_t lwres_strlcpy(char *dst, const char *src, size_t size); LWRES_LANG_ENDDECLS diff --git a/lib/lwres/include/lwres/string.h b/lib/lwres/include/lwres/string.h new file mode 100644 index 0000000000..deebb5a51c --- /dev/null +++ b/lib/lwres/include/lwres/string.h @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC") + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef LWRES_STRING_H +#define LWRES_STRING_H 1 + +/*! \file lwres/string.h */ + +#include + +#include +#include + +#ifdef LWRES_PLATFORM_NEEDSTRLCPY +#define strlcpy lwres_strlcpy +#endif + +LWRES_LANG_BEGINDECLS + +size_t lwres_strlcpy(char *dst, const char *src, size_t size); + +LWRES_LANG_ENDDECLS + +#endif diff --git a/lib/lwres/lwconfig.c b/lib/lwres/lwconfig.c index bbb781099b..0edf92a690 100644 --- a/lib/lwres/lwconfig.c +++ b/lib/lwres/lwconfig.c @@ -61,11 +61,12 @@ #include #include -#include #include #include #include #include +#include +#include #include "assert_p.h" #include "context_p.h" diff --git a/lib/lwres/print.c b/lib/lwres/print.c index 4c0f5aac33..4f44814bec 100644 --- a/lib/lwres/print.c +++ b/lib/lwres/print.c @@ -15,8 +15,6 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id$ */ - #include #include @@ -25,7 +23,8 @@ #define LWRES__PRINT_SOURCE /* Used to get the lwres_print_* prototypes. */ -#include +#include +#include #include "assert_p.h" #include "print_p.h"