diff options
author | Omar Polo <op@omarpolo.com> | 2024-06-08 18:37:57 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2024-06-08 18:37:57 +0000 |
commit | 401030113e383542ae85f2e51bde9f94ff4015f8 (patch) | |
tree | 2f21d5f5c19c85e2ce3efb50b7d3f6a0407c6336 /configure | |
parent | fcf3f1fa9a0d6b30a189e7e71fc55348d72595ce (diff) |
change the approach for strnvis
instead of making things more obscure via gmid_strnvis(), let's
just check for strnvis with -Werror so we can swap the OS broken
implementation with the bundled OpenBSD one.
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 17 |
1 files changed, 5 insertions, 12 deletions
@@ -275,7 +275,6 @@ fi HAVE_ENDIAN_H=0 HAVE_SYS_ENDIAN_H=0 HAVE_MACHINE_ENDIAN=0 -HAVE_BROKEN_STRNVIS=0 runtest endian_h ENDIAN_H || \ runtest sys_endian_h SYS_ENDIAN_H || \ @@ -316,12 +315,12 @@ runtest strtonum STRTONUM -D_OPENBSD_SOURCE || true runtest timingsafe_memcmp TIMINGSAFE_MEMCMP || true runtest tree_h TREE_H || true runtest vasprintf VASPRINTF -D_GNU_SOURCE || true -runtest vis VIS -DLIBBSD_OPENBSD_VIS || true -if [ ${HAVE_VIS} -eq 1 ]; then - if singletest broken-strnvis BROKEN_STRNVIS "-Wall -Werror"; then - HAVE_BROKEN_STRNVIS=1 - fi +# strnvis is a bit special since NetBSD, FreeBSD and MacOS have +# the broken version with the wrong semantics and arguments. +# Hence the -Wall -Werror check. +if ! singletest strnvis STRNVIS "-Wall -Werror"; then + CFLAGS="-I ${PWD}/compat/vis ${CFLAGS} ${CFLAGS}" fi if [ ${HAVE_ARC4RANDOM} -eq 1 -a ${HAVE_ARC4RANDOM_BUF} -eq 0 ]; then @@ -395,10 +394,6 @@ if [ ${HAVE_QUEUE_H} -eq 0 -o ${HAVE_IMSG} -eq 0 -o ${HAVE_TREE_H} -eq 0 ]; then CFLAGS="${CFLAGS} -I ${PWD}/compat" fi -if [ ${HAVE_VIS} -eq 0 ]; then - CFLAGS="${CFLAGS} -I ${PWD}/compat/vis" -fi - if [ $HAVE_LIBEVENT2 -eq 1 ]; then CFLAGS="$CFLAGS -DHAVE_LIBEVENT2=1" fi @@ -655,8 +650,6 @@ cat <<__HEREDOC__ # define HOST_NAME_MAX 255 # endif #endif - -#define HAVE_BROKEN_STRNVIS ${HAVE_BROKEN_STRNVIS} __HEREDOC__ echo "file config.h: written" 1>&2 |