diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2013-12-31 23:19:04 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2013-12-31 23:19:04 +0000 |
commit | 6f0b0fbe92a133fce77709fc467fc17dde75240f (patch) | |
tree | 8654c8795f476bf88c59e942ab992e2c86bbbeb3 | |
parent | 196c1479abe077f801972940e1be2153500130fd (diff) | |
download | mandoc-6f0b0fbe92a133fce77709fc467fc17dde75240f.tar.gz mandoc-6f0b0fbe92a133fce77709fc467fc17dde75240f.tar.zst mandoc-6f0b0fbe92a133fce77709fc467fc17dde75240f.zip |
Provide strcasestr(3) and strsep(3) for Solaris 10 compat;
reported missing by Matthias Scheler <tron at NetBSD> via wiz@.
-rw-r--r-- | Makefile | 14 | ||||
-rw-r--r-- | config.h.post | 6 |
2 files changed, 19 insertions, 1 deletions
@@ -78,8 +78,10 @@ SRCS = Makefile \ chars.in \ compat_fgetln.c \ compat_getsubopt.c \ + compat_strcasestr.c \ compat_strlcat.c \ compat_strlcpy.c \ + compat_strsep.c \ config.h.post \ config.h.pre \ demandoc.1 \ @@ -203,8 +205,10 @@ LIBMANDOC_OBJS = $(LIBMAN_OBJS) \ COMPAT_OBJS = compat_fgetln.o \ compat_getsubopt.o \ + compat_strcasestr.o \ compat_strlcat.o \ - compat_strlcpy.o + compat_strlcpy.o \ + compat_strsep.o arch.o: arch.in att.o: att.in @@ -419,6 +423,14 @@ config.h: config.h.pre config.h.post echo '#define HAVE_BETOH64'; \ rm test-betoh64; \ fi; \ + if $(CC) $(CFLAGS) -Werror -Wno-unused -o test-strcasestr test-strcasestr.c >> config.log 2>&1; then \ + echo '#define HAVE_STRCASESTR'; \ + rm test-strcasestr; \ + fi; \ + if $(CC) $(CFLAGS) -Werror -Wno-unused -o test-strsep test-strsep.c >> config.log 2>&1; then \ + echo '#define HAVE_STRSEP'; \ + rm test-strsep; \ + fi; \ echo; \ cat config.h.post \ ) > $@ diff --git a/config.h.post b/config.h.post index 9a33671b..ab9d8c6b 100644 --- a/config.h.post +++ b/config.h.post @@ -27,12 +27,18 @@ # endif #endif +#ifndef HAVE_STRCASESTR +extern char *strcasestr(const char *, const char *); +#endif #ifndef HAVE_STRLCAT extern size_t strlcat(char *, const char *, size_t); #endif #ifndef HAVE_STRLCPY extern size_t strlcpy(char *, 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; |