aboutsummaryrefslogtreecommitdiffstats
path: root/m4/std-gnu11.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/std-gnu11.m4')
-rw-r--r--m4/std-gnu11.m420
1 files changed, 13 insertions, 7 deletions
diff --git a/m4/std-gnu11.m4 b/m4/std-gnu11.m4
index a687cdbba1e..e8d3ebcf2fd 100644
--- a/m4/std-gnu11.m4
+++ b/m4/std-gnu11.m4
@@ -1,8 +1,8 @@
1# Prefer GNU C11 and C++11 to earlier versions. -*- coding: utf-8 -*- 1# Prefer GNU C11 and C++11 to earlier versions. -*- coding: utf-8 -*-
2 2
3# This implementation is taken from GNU Autoconf lib/autoconf/c.m4 3# This implementation is taken from GNU Autoconf lib/autoconf/c.m4
4# commit 5ad3567c3cbd90b4faa6539c35bc4a8c6500f535 4# commit 739cdc82b5325402231f3f5e1a38f681fcbd1db2
5# dated 2015-10-08 10:12:41 2015 +0200. 5# dated Tue Mar 15 09:34:11 2016 -0700.
6# This implementation will be obsolete once we can assume Autoconf 2.70 6# This implementation will be obsolete once we can assume Autoconf 2.70
7# or later is installed everywhere a Gnulib program might be developed. 7# or later is installed everywhere a Gnulib program might be developed.
8 8
@@ -58,6 +58,9 @@ fi
58if test -z "$CC"; then 58if test -z "$CC"; then
59 AC_CHECK_TOOLS(CC, cl.exe) 59 AC_CHECK_TOOLS(CC, cl.exe)
60fi 60fi
61if test -z "$CC"; then
62 AC_CHECK_TOOL(CC, clang)
63fi
61]) 64])
62 65
63test -z "$CC" && AC_MSG_FAILURE([no acceptable C compiler found in \$PATH]) 66test -z "$CC" && AC_MSG_FAILURE([no acceptable C compiler found in \$PATH])
@@ -123,7 +126,7 @@ if test -z "$CXX"; then
123 else 126 else
124 AC_CHECK_TOOLS(CXX, 127 AC_CHECK_TOOLS(CXX,
125 [m4_default([$1], 128 [m4_default([$1],
126 [g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC])], 129 [g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++])],
127 g++) 130 g++)
128 fi 131 fi
129fi 132fi
@@ -198,6 +201,7 @@ AS_IF([test "x$ac_cv_prog_cc_$1" != xno], [$5], [$6])
198AC_DEFUN([_AC_C_C99_TEST_HEADER], 201AC_DEFUN([_AC_C_C99_TEST_HEADER],
199[[#include <stdarg.h> 202[[#include <stdarg.h>
200#include <stdbool.h> 203#include <stdbool.h>
204#include <stddef.h>
201#include <stdlib.h> 205#include <stdlib.h>
202#include <wchar.h> 206#include <wchar.h>
203#include <stdio.h> 207#include <stdio.h>
@@ -432,7 +436,9 @@ struct anonymous
432[_AC_C_C99_TEST_BODY[ 436[_AC_C_C99_TEST_BODY[
433 v1.i = 2; 437 v1.i = 2;
434 v1.w.k = 5; 438 v1.w.k = 5;
435 _Static_assert (&v1.i == &v1.w.k, "Anonymous union alignment botch"); 439 _Static_assert ((offsetof (struct anonymous, i)
440 == offsetof (struct anonymous, w.k)),
441 "Anonymous union alignment botch");
436]], 442]],
437dnl Try 443dnl Try
438dnl GCC -std=gnu11 (unused restrictive mode: -std=c11) 444dnl GCC -std=gnu11 (unused restrictive mode: -std=c11)
@@ -754,9 +760,9 @@ AC_DEFUN([_AC_CXX_CXX11_TEST_BODY],
754} 760}
755{ 761{
756 // Unicode literals 762 // Unicode literals
757 char *utf8 = u8"UTF-8 string \u2500"; 763 char const *utf8 = u8"UTF-8 string \u2500";
758 char16_t *utf16 = u"UTF-8 string \u2500"; 764 char16_t const *utf16 = u"UTF-8 string \u2500";
759 char32_t *utf32 = U"UTF-32 string \u2500"; 765 char32_t const *utf32 = U"UTF-32 string \u2500";
760} 766}
761]]) 767]])
762 768