+2020-12-19 Paul Eggert <eggert@cs.ucla.edu>
+
+ free-posix: port to GNU/Linux
+ * m4/free.m4 (gl_FUNC_FREE): Don’t assume GNU hosts are free of
+ the bug, as it occurs on Ubuntu 20.10 x86-64 and, I assume, on
+ other GNU/Linux hosts.
+
2020-12-19 Bruno Haible <bruno@clisp.org>
free-posix: Add tests.
-# free.m4 serial 2
+# free.m4 serial 3
# Copyright (C) 2003-2005, 2009-2020 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
AC_DEFUN([gl_FUNC_FREE],
[
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
- AC_REQUIRE([AC_CANONICAL_HOST])
dnl In the next release of POSIX, free must preserve errno.
dnl https://www.austingroupbugs.net/view.php?id=385
dnl whatever that happens to be.
AC_CACHE_CHECK([whether free is known to preserve errno],
[gl_cv_func_free_preserves_errno],
- [case $host_os in
- *-gnu* | gnu*)
- gl_cv_func_free_preserves_errno=yes;;
- *)
- AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [[#include <unistd.h>
- ]],
- [[#if _POSIX_VERSION <= 200809
- #error "'free' is not known to preserve errno"
- #endif
- ]])],
- [gl_cv_func_free_preserves_errno=yes],
- [gl_cv_func_free_preserves_errno=no]);;
- esac
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <unistd.h>
+ ]],
+ [[#if _POSIX_VERSION <= 200809
+ #error "'free' is not known to preserve errno"
+ #endif
+ ]])],
+ [gl_cv_func_free_preserves_errno=yes],
+ [gl_cv_func_free_preserves_errno=no])
])
case $gl_cv_func_free_preserves_errno in