From aedbe76e8443757d8553a35fdc217722dcd1470b Mon Sep 17 00:00:00 2001 From: Duncaen Date: Mon, 27 Jun 2016 18:18:42 +0200 Subject: [PATCH] fix sys/tree.h test --- configure | 22 ++++++++++++---------- env.c | 4 ---- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/configure b/configure index b5cbf80..48a515a 100755 --- a/configure +++ b/configure @@ -266,16 +266,6 @@ int main(void) { check_func "bsd_auth_h" "$src" && \ have_bsd_auth_h=1 -# -# Check for sys/tree.h. -# -src=' -#include -int main(void) { - return 0; -}' -check_func "sys_tree_h" "$src" - # # Check for pam_appl.h. # @@ -342,3 +332,15 @@ int main(void) { check_func "pledge" "$src" || { printf 'OPENBSD += pledge-noop.o\n' >>$CONFIG_MK } + +# +# +# +src=' +#include +int main(void){return 0;} +__attribute__((__unused__)) static void foo(void){return;} +' +check_func "__attribute__" "$src" || { + printf 'CFLAGS += -DNO_ATTRIBUTE_ON_RETURN_TYPE=1\n' >>$CONFIG_MK +} diff --git a/env.c b/env.c index 9baf4a5..f25d21f 100644 --- a/env.c +++ b/env.c @@ -16,11 +16,7 @@ */ #include -#ifdef HAVE_SYS_TREE_H -#include -#else #include "sys-tree.h" -#endif #include #include -- 2.39.2