From f2e1d1437abddaa097ebff0dcf3f147764f94df0 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sat, 4 Jan 2014 13:49:22 +0000 Subject: Merge strnlen(3) configuration bits. --- Makefile | 3 +++ config.h.post | 19 ++++++++++--------- configure | 1 + 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 9b9e8426..69b0d139 100644 --- a/Makefile +++ b/Makefile @@ -66,6 +66,7 @@ TESTSRCS = test-betoh64.c \ test-mmap.c \ test-strlcat.c \ test-strlcpy.c \ + test-strnlen.c \ test-strptime.c SRCS = Makefile \ @@ -89,6 +90,7 @@ SRCS = Makefile \ compat_strcasestr.c \ compat_strlcat.c \ compat_strlcpy.c \ + compat_strnlen.c \ compat_strsep.c \ config.h.post \ config.h.pre \ @@ -210,6 +212,7 @@ COMPAT_OBJS = compat_fgetln.o \ compat_strcasestr.o \ compat_strlcat.o \ compat_strlcpy.o \ + compat_strnlen.o \ compat_strsep.o arch.o: arch.in diff --git a/config.h.post b/config.h.post index ab9d8c6b..674c8c2a 100644 --- a/config.h.post +++ b/config.h.post @@ -1,5 +1,3 @@ -#include - #if !defined(__BEGIN_DECLS) # ifdef __cplusplus # define __BEGIN_DECLS extern "C" { @@ -27,6 +25,13 @@ # endif #endif +#ifndef HAVE_FGETLN +extern char *fgetln(FILE *, size_t *); +#endif +#ifndef HAVE_GETSUBOPT +extern int getsubopt(char **, char * const *, char **); +extern char *suboptarg; +#endif #ifndef HAVE_STRCASESTR extern char *strcasestr(const char *, const char *); #endif @@ -36,15 +41,11 @@ extern size_t strlcat(char *, const char *, size_t); #ifndef HAVE_STRLCPY extern size_t strlcpy(char *, const char *, size_t); #endif +#ifndef HAVE_STRNLEN +extern size_t strnlen(const char *, size_t); +#endif #ifndef HAVE_STRSEP extern char *strsep(char **, const char *); #endif -#ifndef HAVE_GETSUBOPT -extern int getsubopt(char **, char * const *, char **); -extern char *suboptarg; -#endif -#ifndef HAVE_FGETLN -extern char *fgetln(FILE *, size_t *); -#endif #endif /* MANDOC_CONFIG_H */ diff --git a/configure b/configure index 4465178a..be5d38c6 100755 --- a/configure +++ b/configure @@ -37,6 +37,7 @@ runtest mmap MMAP runtest strcasestr STRCASESTR runtest strlcat STRLCAT runtest strlcpy STRLCPY +runtest strnlen STRNLEN runtest strptime STRPTIME runtest strsep STRSEP echo -- cgit v1.2.3-56-ge451