Skip to content

Commit

Permalink
Make memmem impl usable from multiple places
Browse files Browse the repository at this point in the history
by making 3rdparty/freebsd/memmem.c part of the
objects lists and removing the implementation from
the memmem header file
  • Loading branch information
timo committed Aug 30, 2020
1 parent 489ab69 commit 6366564
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions 3rdparty/freebsd/memmem.c
@@ -1,3 +1,4 @@
#if defined(_WIN32) || defined(__APPLE__) || defined(__Darwin__) || defined(__sun)
/*-
* Copyright (c) 2005-2014 Rich Felker, et al.
*
Expand Down Expand Up @@ -179,3 +180,4 @@ void *memmem(const void *h0, size_t k, const void *n0, size_t l)

return twoway_memmem(h, h+k, n, l);
}
#endif
1 change: 1 addition & 0 deletions build/Makefile.in
Expand Up @@ -243,6 +243,7 @@ OBJECTS2 = src/6model/reprs/MVMDLLSym@obj@ \
src/platform/sys@obj@ \
src/platform/random@obj@ \
src/platform/memmem32@obj@ \
3rdparty/freebsd/memmem@obj@ \
src/platform/malloc_trim@obj@ \
src/moar@obj@ \
@platform@ \
Expand Down
2 changes: 1 addition & 1 deletion src/platform/memmem.h
Expand Up @@ -7,7 +7,7 @@
* Solaris doesn't seem to have memmem */

#if defined(_WIN32) || defined(__APPLE__) || defined(__Darwin__) || defined(__sun)
#include "../3rdparty/freebsd/memmem.c"
void *memmem(const void *h0, size_t k, const void *n0, size_t l);
#else
/* On systems that use glibc, you must define _GNU_SOURCE before including string.h
* to get access to memmem. */
Expand Down

0 comments on commit 6366564

Please sign in to comment.