summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac1
-rw-r--r--openbsd-compat/Makefile.in1
-rw-r--r--openbsd-compat/memmem.c5
-rw-r--r--openbsd-compat/openbsd-compat.h4
4 files changed, 11 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 958e99fd4..63e017733 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1751,6 +1751,7 @@ AC_CHECK_FUNCS([ \
1751 llabs \ 1751 llabs \
1752 login_getcapbool \ 1752 login_getcapbool \
1753 md5_crypt \ 1753 md5_crypt \
1754 memmem \
1754 memmove \ 1755 memmove \
1755 memset_s \ 1756 memset_s \
1756 mkdtemp \ 1757 mkdtemp \
diff --git a/openbsd-compat/Makefile.in b/openbsd-compat/Makefile.in
index 2cc343636..1162dc550 100644
--- a/openbsd-compat/Makefile.in
+++ b/openbsd-compat/Makefile.in
@@ -34,6 +34,7 @@ OPENBSD=base64.o \
34 inet_ntoa.o \ 34 inet_ntoa.o \
35 inet_ntop.o \ 35 inet_ntop.o \
36 md5.o \ 36 md5.o \
37 memmem.o \
37 mktemp.o \ 38 mktemp.o \
38 pwcache.o \ 39 pwcache.o \
39 readpassphrase.o \ 40 readpassphrase.o \
diff --git a/openbsd-compat/memmem.c b/openbsd-compat/memmem.c
index 823443b08..3e5e6b5e6 100644
--- a/openbsd-compat/memmem.c
+++ b/openbsd-compat/memmem.c
@@ -27,6 +27,10 @@
27 * SUCH DAMAGE. 27 * SUCH DAMAGE.
28 */ 28 */
29 29
30#include "includes.h"
31
32#ifndef HAVE_MEMMEM
33
30#include <string.h> 34#include <string.h>
31 35
32/* 36/*
@@ -62,3 +66,4 @@ memmem(const void *l, size_t l_len, const void *s, size_t s_len)
62 return NULL; 66 return NULL;
63} 67}
64DEF_WEAK(memmem); 68DEF_WEAK(memmem);
69#endif /* HAVE_MEMMEM */
diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h
index 86d45317b..fda6706f8 100644
--- a/openbsd-compat/openbsd-compat.h
+++ b/openbsd-compat/openbsd-compat.h
@@ -73,6 +73,10 @@ int getpagesize(void);
73char *getcwd(char *pt, size_t size); 73char *getcwd(char *pt, size_t size);
74#endif 74#endif
75 75
76#ifdef HAVE_MEMMEM
77void *memmem(const void *, size_t, const void *, size_t);
78#endif
79
76#ifndef HAVE_REALLOCARRAY 80#ifndef HAVE_REALLOCARRAY
77void *reallocarray(void *, size_t, size_t); 81void *reallocarray(void *, size_t, size_t);
78#endif 82#endif