Discussion:
[SCM] GNU Autoconf source repository branch, master, updated. v2.69-56-gca8b864
Paul Eggert
2012-12-27 22:35:23 UTC
Permalink
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Autoconf source repository".

http://git.sv.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=ca8b864f431faeae3caeac671e339c75c775e5a6

The branch, master has been updated
via ca8b864f431faeae3caeac671e339c75c775e5a6 (commit)
from 851ef517963d1e1966c4082530d5e87ba0a415ab (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ca8b864f431faeae3caeac671e339c75c775e5a6
Author: Paul Eggert <***@cs.ucla.edu>
Date: Thu Dec 27 14:34:07 2012 -0800

AC_C__GENERIC: New macro.

* NEWS, doc/autoconf.texi (C Compiler): Document it.
* lib/autoconf/c.m4 (AC_C__GENERIC): Implement it.

-----------------------------------------------------------------------

Summary of changes:
NEWS | 2 ++
doc/autoconf.texi | 7 +++++++
lib/autoconf/c.m4 | 27 +++++++++++++++++++++++++++
3 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/NEWS b/NEWS
index 185ca26..a4cd3a1 100644
--- a/NEWS
+++ b/NEWS
@@ -10,6 +10,8 @@ GNU Autoconf NEWS - User visible changes.

** Macros

+- New macro AC_C__GENERIC.
+
- AC_CONFIG_MACRO_DIRS
New macro, used to declare multiple directories when looking for
local M4 macros. This macro overcomes some of the shortfalls in the
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index aa948a9..bcf8f86 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -7434,6 +7434,13 @@ This macro is obsolescent, as current C compilers support @code{const}.
New programs need not use this macro.
@end defmac

+@defmac AC_C__GENERIC
+@acindex{C__GENERIC}
+@cvindex _Generic
+If the C compiler supports C11-style generic selection using the
+@code{_Generic} keyword, define @code{HAVE_C__GENERIC}.
+@end defmac
+
@defmac AC_C_RESTRICT
@acindex{C_RESTRICT}
@cvindex restrict
diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4
index e17df1e..edc663b 100644
--- a/lib/autoconf/c.m4
+++ b/lib/autoconf/c.m4
@@ -1690,6 +1690,33 @@ dnl default behavior for universal builds.
])# AC_C_BIGENDIAN


+# AC_C__GENERIC
+# -------------
+# Define HAVE_C__GENERIC if _Generic works, a la C11.
+AN_IDENTIFIER([_Generic], [AC_C__GENERIC])
+AC_DEFUN([AC_C__GENERIC],
+[AC_CACHE_CHECK([for _Generic], ac_cv_c__Generic,
+[AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE(
+ [[int
+ main (int argc, char **argv)
+ {
+ int a = _Generic (argc, int: argc = 1);
+ int *b = &_Generic (argc, default: argc);
+ char ***c = _Generic (argv, int: argc, default: argv ? &argv : 0);
+ _Generic (1 ? 0 : b, int: a, default: b) = &argc;
+ _Generic (a = 1, default: a) = 3;
+ return a + !b + !c;
+ }
+ ]])],
+ [ac_cv_c__Generic=yes],
+ [ac_cv_c__Generic=no])])
+if test $ac_cv_c__Generic = yes; then
+ AC_DEFINE([HAVE_C__GENERIC], 1,
+ [Define to 1 if C11-style _Generic works.])
+fi
+])# AC_C__GENERIC
+
# AC_C_INLINE
# -----------
# Do nothing if the compiler accepts the inline keyword.


hooks/post-receive
--
GNU Autoconf source repository
Loading...