From 26aab9ba94d382741c4191505339f753eeca9483 Mon Sep 17 00:00:00 2001 From: Francois Kritzinger Date: Fri, 11 Feb 2022 13:38:01 +0200 Subject: [PATCH] Fix HAVE_F16C and LIBC_VERSION --- .../libbuild2/autoconf/checks/HAVE_F16C.h | 13 +++++++++++-- .../libbuild2/autoconf/checks/LIBC_VERSION.h | 9 +++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_F16C.h b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_F16C.h index 271fe17..783a2b7 100644 --- a/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_F16C.h +++ b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_F16C.h @@ -10,9 +10,18 @@ * https://docs.microsoft.com/en-us/cpp/intrinsics/x86-intrinsics-list * https://docs.microsoft.com/en-us/cpp/intrinsics/x64-amd64-intrinsics-list) * + * Instead we make use of the fact that all processors that support AVX2 + * also support F16C. + * * Supported since Intel's Ivy Bridge (2012) and AMD's Bulldozer (2011). Added * to GCC 4.6.4 (2013) at the latest. */ -#ifdef __F16C__ -# define HAVE_F16C 1 +#ifdef _MSC_VER +# ifdef __AVX2__ +# define HAVE_F16C 1 +# endif +#else +# ifdef __F16C__ +# define HAVE_F16C 1 +# endif #endif diff --git a/libbuild2-autoconf/libbuild2/autoconf/checks/LIBC_VERSION.h b/libbuild2-autoconf/libbuild2/autoconf/checks/LIBC_VERSION.h index 1057762..8cca04d 100644 --- a/libbuild2-autoconf/libbuild2/autoconf/checks/LIBC_VERSION.h +++ b/libbuild2-autoconf/libbuild2/autoconf/checks/LIBC_VERSION.h @@ -82,8 +82,13 @@ */ #if defined(__linux__) # include /* __GLIBC__, __GLIBC_MINOR__, __GLIBC_PREREQ() */ -#elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) -# include /* __FreeBSD_version, OpenBSD, __NetBSD_Version__ */ +#elif defined(__FreeBSD__) +# include /* __FreeBSD_version */ +#elif defined(__OpenBSD__) || defined(__NetBSD__) +/* Note: sys/param.h defines macros with common names such as ALIGN which may + * clash with user code (see Qt). + */ +# include /* OpenBSD, __NetBSD_Version__ */ #elif defined(__APPLE__) # include /* __MAC_OS_X_VERSION_MIN_REQUIRED */ #endif