From: Evan Hunt Date: Wed, 6 Aug 2014 05:02:05 +0000 (-0700) Subject: [v9_8] make lwres/stdlib.h and lwres/string.h instead of compat.h X-Git-Tag: v9.8.8b2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfaa7c505f260fce2c244a637d6f3a5c92e6bc2f;p=thirdparty%2Fbind9.git [v9_8] make lwres/stdlib.h and lwres/string.h instead of compat.h --- diff --git a/lib/lwres/compat.c b/lib/lwres/compat.c index 9edc5658b9e..2f59da2f019 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$ */ - #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 be1f09aafb4..133f0c1f9ec 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 19a93721666..4ee1dd2dacc 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 00000000000..deebb5a51c4 --- /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 06dab6eebeb..32019b97318 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 4c0f5aac33b..4f44814bece 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"