[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 201/335: configure: added detection of the binary format
From: |
gnunet |
Subject: |
[libmicrohttpd] 201/335: configure: added detection of the binary format of NULL pointers |
Date: |
Sat, 27 Jul 2024 22:01:37 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to tag stf-m2
in repository libmicrohttpd.
commit 5df542a73bbefd2aba9c68b20ae20c9d98c473bd
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Mon May 20 18:03:19 2024 +0200
configure: added detection of the binary format of NULL pointers
---
configure.ac | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 68 insertions(+)
diff --git a/configure.ac b/configure.ac
index 0e052009..6c27fc94 100644
--- a/configure.ac
+++ b/configure.ac
@@ -871,6 +871,74 @@ AS_VAR_IF([[mhd_cv_macro_true_false_valid]], [["yes"]],
[[:]],
[AC_MSG_ERROR([[Value of "true" or value of "false" is not valid. Check
config.log for details.]])])
+AC_CACHE_CHECK([whether the NULL pointer has all zero bits],
+ [mhd_cv_ptr_null_all_zeros],
+ [
+ AC_RUN_IFELSE(
+ [
+ AC_LANG_SOURCE([[
+#include <string.h>
+#if defined(HAVE_STDDEF_H)
+#include <stddef.h>
+#elif define(HAVE_STDLIB_H)
+#include <stdlib.h>
+#else
+#include <stdio.h>
+#endif
+
+int main(void)
+{
+ void *ptr1;
+ void *ptr2;
+
+ ptr1 = &ptr2;
+ ptr2 = NULL;
+ memset(&ptr1, 0, sizeof(ptr1));
+ if (ptr2 != ptr1)
+ return 2;
+
+ ptr2 = &ptr1;
+ ptr1 = NULL;
+ memset(&ptr2, 0, sizeof(ptr2));
+ if (0 != memcmp (&ptr1, &ptr2, sizeof(ptr1)))
+ return 3;
+
+ ptr1 = &ptr1;
+ ptr2 = &ptr2;
+ memset(&ptr1, 0, sizeof(ptr1));
+ memset(&ptr2, 0, sizeof(ptr2));
+ if (NULL != ptr1)
+ return 4;
+ if (NULL != ptr2)
+ return 5;
+
+ return 0;
+}
+ ]]
+ )
+ ],
+ [mhd_cv_ptr_null_all_zeros="yes"],
+ [mhd_cv_ptr_null_all_zeros="no"],
+ [
+ AS_CASE([$host_cpu],dnl
+
[[i[234567]86|x86_64|amd64|arm|armeb|armv[0123456789]|armv[0123456789]eb|aarch64|aarch64_be|arm64|mips|mipsel|mips64|mips64el|powerpc|powerpcle|powerpc64|powerpc64le|riscv32|riscv32be|riscv64|riscv64be]],
+ [
+ AS_CASE([$host_os],dnl
+
[[linux*|freebsd|cygwin|mingw*|msys|gnu|netbsd*|openbsd*|darwin*|solaris2*|haiku]],
+ [mhd_cv_ptr_null_all_zeros="assuming yes"],
+ [mhd_cv_ptr_null_all_zeros="assuming no"]
+ )
+ ],
+ [mhd_cv_ptr_null_all_zeros="assuming no"]
+ )
+ ]
+ )
+ ]
+)
+AS_IF([test "x${mhd_cv_ptr_null_all_zeros}" = "xyes" || test
"x${mhd_cv_ptr_null_all_zeros}" = "xassuming yes"],
+ [AC_DEFINE([HAVE_NULL_PTR_ALL_ZEROS],[1],[Define to '1' if NULL pointers
binary representation is all zero bits])]
+)
+
AC_C_INLINE
AS_UNSET([errattr_CFLAGS])
CFLAGS="${user_CFLAGS}"
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] 172/335: sys_base_types.h: new internal header, (continued)
- [libmicrohttpd] 172/335: sys_base_types.h: new internal header, gnunet, 2024/07/27
- [libmicrohttpd] 192/335: GENERATED: check the state before using the options, gnunet, 2024/07/27
- [libmicrohttpd] 184/335: GENERATED: fixed License version, gnunet, 2024/07/27
- [libmicrohttpd] 179/335: microhttpd2_portability.h: lowered scope of included system headers, minor refactoring, gnunet, 2024/07/27
- [libmicrohttpd] 173/335: sys_bool_type.h: new internal header, gnunet, 2024/07/27
- [libmicrohttpd] 196/335: GENERATED: copy some temporal pointers, gnunet, 2024/07/27
- [libmicrohttpd] 175/335: mhd_sys_options.h: improved doxy, gnunet, 2024/07/27
- [libmicrohttpd] 181/335: microhttpd2_portability.h: added FIXME comments, gnunet, 2024/07/27
- [libmicrohttpd] 195/335: GENERATED: use pointer for the daemon settings, gnunet, 2024/07/27
- [libmicrohttpd] 198/335: This API is even more *TERRIBLE*, gnunet, 2024/07/27
- [libmicrohttpd] 201/335: configure: added detection of the binary format of NULL pointers,
gnunet <=
- [libmicrohttpd] 183/335: configure: fixed configuration summary, gnunet, 2024/07/27
- [libmicrohttpd] 197/335: GENERATED: use logger directly, gnunet, 2024/07/27
- [libmicrohttpd] 204/335: configure: improved checks for function name magic-macros, gnunet, 2024/07/27
- [libmicrohttpd] 202/335: configure: added detection of variadic macros support, gnunet, 2024/07/27
- [libmicrohttpd] 190/335: GENERATED: C89/C99, gnunet, 2024/07/27
- [libmicrohttpd] 208/335: .gitignore: updated, gnunet, 2024/07/27
- [libmicrohttpd] 210/335: configure: improved tests for non-standard platforms, gnunet, 2024/07/27
- [libmicrohttpd] 193/335: GENERATED: add missed options, gnunet, 2024/07/27
- [libmicrohttpd] 191/335: GENERATED: fixed options addressing, gnunet, 2024/07/27
- [libmicrohttpd] 211/335: configure: check for AF_UNIX headers, gnunet, 2024/07/27