From 388a1655d4d94141a979a058e737eb573c8ed257 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Thu, 10 Jul 2014 16:02:49 -0500 Subject: better fix for __bounded removal --- configure.ac | 11 +++-------- include/sys/types.h | 4 ++++ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index 82a6be4..ffa1786 100644 --- a/configure.ac +++ b/configure.ac @@ -8,14 +8,6 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AC_SUBST([USER_CFLAGS], "-O2 $CFLAGS") CFLAGS="$CFLAGS -Wall -Werror -std=c99 -g -Wno-pointer-sign -DHAVE_CRYPTODEV -DLIBRESSL_INTERNAL" -case $target_os in - *openbsd*) - ;; - *) - CFLAGS="$CFLAGS -D__bounded__(x,y,z)" - ;; -esac - case $target_os in *darwin*) TARGET_OS=darwin; @@ -30,6 +22,9 @@ case $target_os in CFLAGS="$CFLAGS -D__EXTENSIONS__ -D_XOPEN_SOURCE=600 -DBSD_COMP" AC_SUBST([PLATFORM_LDADD], ['-lnsl -lsocket']) ;; + *openbsd*) + AC_DEFINE([HAVE_ATTRIBUTE__BOUNDED__], [1], [OpenBSD gcc has bounded]) + ;; *) ;; esac diff --git a/include/sys/types.h b/include/sys/types.h index 05fc05b..3904bcb 100644 --- a/include/sys/types.h +++ b/include/sys/types.h @@ -10,4 +10,8 @@ typedef uint8_t u_int8_t; typedef uint32_t u_int32_t; #endif +#if !defined(HAVE_ATTRIBUTE__BOUNDED__) && !defined(__bounded__) +# define __bounded__(x, y, z) +#endif + #endif -- cgit v1.2.3-55-g6feb