From d72596f4864903ab7b8365c0539ca6dfd34d8e04 Mon Sep 17 00:00:00 2001 From: Francois Kritzinger Date: Mon, 17 Jan 2022 11:30:15 +0200 Subject: [PATCH] Add checks for explicit_bzero(), explicit_memset() --- .../libbuild2/autoconf/checks/HAVE_EXPLICIT_BZERO.h | 12 ++++++++++++ .../libbuild2/autoconf/checks/HAVE_EXPLICIT_MEMSET.h | 9 +++++++++ 2 files changed, 21 insertions(+) create mode 100644 libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_EXPLICIT_BZERO.h create mode 100644 libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_EXPLICIT_MEMSET.h diff --git a/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_EXPLICIT_BZERO.h b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_EXPLICIT_BZERO.h new file mode 100644 index 0000000..8f360ae --- /dev/null +++ b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_EXPLICIT_BZERO.h @@ -0,0 +1,12 @@ +// HAVE_EXPLICIT_BZERO + +#undef HAVE_EXPLICIT_BZERO + +/* Since FreeBSD 11, OpenBSD 5.5, and glibc 2.25. + */ +#if (defined(__FreeBSD__) && __FreeBSD__ >= 11) || \ + (defined(__OpenBSD__) && defined(OpenBSD) && OpenBSD >= 201405) || \ + (defined(__GLIBC__) && defined(__GLIBC_MINOR__) && \ + (__GLIBC__ > 2 || __GLIBC__ == 2 && __GLIBC_MINOR__ >= 25)) +# define HAVE_EXPLICIT_BZERO 1 +#endif diff --git a/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_EXPLICIT_MEMSET.h b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_EXPLICIT_MEMSET.h new file mode 100644 index 0000000..424238e --- /dev/null +++ b/libbuild2-autoconf/libbuild2/autoconf/checks/HAVE_EXPLICIT_MEMSET.h @@ -0,0 +1,9 @@ +// HAVE_EXPLICIT_MEMSET + +#undef HAVE_EXPLICIT_MEMSET + +/* Since NetBSD 7.0.0. + */ +#if defined(__NetBSD_Version__) && __NetBSD_Version__ >= 700000000 +# define HAVE_EXPLICIT_MEMSET 1 +#endif