]> Savannah Git Hosting - gnulib.git/commitdiff
aligned_alloc: Fix test failure on OpenBSD 6.8.
authorBruno Haible <bruno@clisp.org>
Fri, 1 Jan 2021 21:50:58 +0000 (22:50 +0100)
committerBruno Haible <bruno@clisp.org>
Fri, 1 Jan 2021 21:50:58 +0000 (22:50 +0100)
* m4/extensions.m4 (gl_USE_SYSTEM_EXTENSIONS): On OpenBSD, define
_ISOC11_SOURCE.
* m4/aligned_alloc.m4 (gl_FUNC_ALIGNED_ALLOC): Update comment.

ChangeLog
m4/aligned_alloc.m4
m4/extensions.m4

index 1989ffcc0d894ded8dd65029a90ca9f15bebb72e..1981befb508b2da531fc7a44ac0ddb56a76c9edd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2021-01-01  Bruno Haible  <bruno@clisp.org>
+
+       aligned_alloc: Fix test failure on OpenBSD 6.8.
+       * m4/extensions.m4 (gl_USE_SYSTEM_EXTENSIONS): On OpenBSD, define
+       _ISOC11_SOURCE.
+       * m4/aligned_alloc.m4 (gl_FUNC_ALIGNED_ALLOC): Update comment.
+
 2021-01-01  Bruno Haible  <bruno@clisp.org>
 
        posixtm tests: Disable part of the test on plaforms where it fails.
index f16ad159c39f2965ea9af2b9494f444e2ab80811..54253edc47e2895b42b67af237c1833c9807b156 100644 (file)
@@ -1,4 +1,4 @@
-# aligned_alloc.m4 serial 1
+# aligned_alloc.m4 serial 2
 dnl Copyright (C) 2020-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -9,7 +9,7 @@ AC_DEFUN([gl_FUNC_ALIGNED_ALLOC],
   AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
 
-  dnl Persuade glibc <stdlib.h> to declare aligned_alloc().
+  dnl Persuade glibc and OpenBSD <stdlib.h> to declare aligned_alloc().
   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
 
   AC_CHECK_FUNCS_ONCE([aligned_alloc])
index f7333acbd4f9e61aafb48526d609d82aae0da803..5792a9557a8637ac9522a1882eb6777ff2bf5855 100644 (file)
@@ -1,4 +1,4 @@
-# serial 21  -*- Autoconf -*-
+# serial 22  -*- Autoconf -*-
 # Enable extensions on systems that normally disable them.
 
 # Copyright (C) 2003, 2006-2021 Free Software Foundation, Inc.
@@ -212,4 +212,16 @@ dnl it should only be defined when necessary.
 AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS],
 [
   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+  dnl On OpenBSD 6.8 with GCC, the include files contain a couple of
+  dnl definitions that are only activated with an explicit -D_ISOC11_SOURCE.
+  dnl That's because this version of GCC (4.2.1) supports the option
+  dnl '-std=gnu99' but not the option '-std=gnu11'.
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  case "$host_os" in
+    openbsd*)
+      AC_DEFINE([_ISOC11_SOURCE], [1],
+        [Define to enable the declarations of ISO C 11 types and functions.])
+      ;;
+  esac
 ])