From b389733ab0fa46f2cecd302cc5826fc7dc322c8e Mon Sep 17 00:00:00 2001 From: Randy Palamar Date: Sat, 6 Dec 2025 08:54:34 -0700 Subject: util: replace memrchr with internal version The amount of code we need to detect if this is present and handle the fallback is more than if we just provide it ourselves. Also we are passing in a difference of pointers so the argument type should be ptrdiff_t. This avoids a C brain damage of having unsigned size type which can wrap around if the caller is careful. --- configure | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'configure') diff --git a/configure b/configure index a70eac1..cc00cd7 100755 --- a/configure +++ b/configure @@ -613,25 +613,6 @@ EOF fi fi -printf "checking for memrchr... " - -cat > "$tmpc" < - -int main(int argc, char *argv[]) { - return !memrchr("\n", '\n', 1); -} -EOF - -if $CC $CFLAGS $CFLAGS_STD "$tmpc" $LDFLAGS -o "$tmpo" >/dev/null 2>&1; then - HAVE_MEMRCHR=1 - printf "%s\n" "yes" -else - HAVE_MEMRCHR=0 - printf "%s\n" "no" -fi - printf "completing config.mk... " exec 3>&1 1>>config.mk @@ -659,7 +640,6 @@ LDFLAGS_ACL = $LDFLAGS_ACL CONFIG_SELINUX = $CONFIG_SELINUX CFLAGS_SELINUX = $CFLAGS_SELINUX LDFLAGS_SELINUX = $LDFLAGS_SELINUX -CFLAGS_LIBC = -DHAVE_MEMRCHR=$HAVE_MEMRCHR EOF exec 1>&3 3>&- -- cgit v1.2.3