From d2004b15f1e90efafedc367335c07ad4636d291d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Fri, 7 Apr 2017 16:04:40 +0200 Subject: text: add mem{r,}chr(3) based byte search functions These are generally implemented efficiently in libc. While memrchr(3) is non-standard, it is a common extension. If it is not available, we use a simple C implementation from musl. --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 8e114e9..ba79108 100644 --- a/Makefile +++ b/Makefile @@ -32,8 +32,11 @@ CFLAGS_STD ?= -std=c99 -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -DNDEBUG CFLAGS_STD += -DVERSION=\"${VERSION}\" LDFLAGS_STD ?= -lc +CFLAGS_LIBC ?= -DHAVE_MEMRCHR=0 + CFLAGS_VIS = $(CFLAGS_AUTO) $(CFLAGS_TERMKEY) $(CFLAGS_CURSES) $(CFLAGS_ACL) \ - $(CFLAGS_SELINUX) $(CFLAGS_TRE) $(CFLAGS_LUA) $(CFLAGS_LPEG) $(CFLAGS_STD) + $(CFLAGS_SELINUX) $(CFLAGS_TRE) $(CFLAGS_LUA) $(CFLAGS_LPEG) $(CFLAGS_STD) \ + $(CFLAGS_LIBC) CFLAGS_VIS += -DVIS_PATH=\"${SHAREPREFIX}/vis\" CFLAGS_VIS += -DCONFIG_HELP=${CONFIG_HELP} -- cgit v1.2.3