autoconf-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Autoconf source repository branch, master, updated. v2.65-74-g


From: Ralf Wildenhues
Subject: [SCM] GNU Autoconf source repository branch, master, updated. v2.65-74-gebc0ae4
Date: Tue, 01 Jun 2010 20:49:24 +0000

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=ebc0ae4a4caf5939d4958421f1a4108b2319c1d4

The branch, master has been updated
       via  ebc0ae4a4caf5939d4958421f1a4108b2319c1d4 (commit)
       via  03bf155e9babf32e7d96c2179836637a38d59d21 (commit)
      from  f44e1243ec5207a8d01b0e9e04f4b8f4799895bc (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 ebc0ae4a4caf5939d4958421f1a4108b2319c1d4
Author: Ralf Wildenhues <address@hidden>
Date:   Tue Jun 1 21:54:39 2010 +0200

    Documentation and tests for the AC_CHECK_DECL change.
    
    * lib/autoconf/general.m4 (_AC_CHECK_DECL_BODY): Squash trailing
    spaces in as_decl_name.
    (_AC_CHECK_DECLS): Likewise for the define.
    * tests/semantics.at (AC_CHECK_DECLS): Extend test.
    * doc/autoconf.texi (Generic Declarations): Update.
    * NEWS: Update.
    
    Signed-off-by: Ralf Wildenhues <address@hidden>

commit 03bf155e9babf32e7d96c2179836637a38d59d21
Author: Joern Rennecke <address@hidden>
Date:   Tue Jun 1 20:06:54 2010 +0200

    Generalize AC_CHECK_DECL for C++: allow optional arguments.
    
    * general.m4 (_AC_CHECK_DECL_BODY): Process trailing function
    argument types as arguments to use for C++.
    (_AC_CHECK_DECLS): Filter out trailing function argument types
    when generating the HAVE_DECL_* macro.
    
    Signed-off-by: Ralf Wildenhues <address@hidden>

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

Summary of changes:
 ChangeLog               |   18 ++++++++++++++++++
 NEWS                    |    3 +++
 doc/autoconf.texi       |   14 +++++++++++---
 lib/autoconf/general.m4 |   15 +++++++++++----
 tests/semantics.at      |   35 +++++++++++++++++++++++++++++++++--
 5 files changed, 76 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1452eb3..fac7c04 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2010-06-01  Ralf Wildenhues  <address@hidden>
+
+       Documentation and tests for the AC_CHECK_DECL change.
+       * lib/autoconf/general.m4 (_AC_CHECK_DECL_BODY): Squash trailing
+       spaces in as_decl_name.
+       (_AC_CHECK_DECLS): Likewise for the define.
+       * tests/semantics.at (AC_CHECK_DECLS): Extend test.
+       * doc/autoconf.texi (Generic Declarations): Update.
+       * NEWS: Update.
+
+2010-06-01  Joern Rennecke  <address@hidden>  (tiny change)
+
+       Generalize AC_CHECK_DECL for C++: allow optional arguments.
+       * general.m4 (_AC_CHECK_DECL_BODY): Process trailing function
+       argument types as arguments to use for C++.
+       (_AC_CHECK_DECLS): Filter out trailing function argument types
+       when generating the HAVE_DECL_* macro.
+
 2010-05-25  Stefano Lattarini  <address@hidden>
            Eric Blake  <address@hidden>
 
diff --git a/NEWS b/NEWS
index afd8907..04cf8dd 100644
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,9 @@ GNU Autoconf NEWS - User visible changes.
 
 ** Autoconf should work on EBCDIC hosts.
 
+** AC_CHECK_DECL and AC_CHECK_DECLS accept optional function argument types
+   for overloaded C++ functions.
+
 * Major changes in Autoconf 2.65 (2009-11-21) [stable]
   Released by Eric Blake, based on git versions 2.64.*.
 
diff --git a/doc/autoconf.texi b/doc/autoconf.texi
index 3df0d3f..eab9ab2 100644
--- a/doc/autoconf.texi
+++ b/doc/autoconf.texi
@@ -6275,8 +6275,14 @@ prior to the declaration under test.
 
 This macro actually tests whether @var{symbol} is defined as a macro or
 can be used as an r-value, not whether it is really declared, because it
-is much safer to avoid
-introducing extra declarations when they are not needed.
+is much safer to avoid introducing extra declarations when they are not
+needed.  In order to facilitate use of C++ and overloaded function
+declarations, it is possible to specify function argument types in
+parentheses for types which can be zero-initialized:
+
address@hidden
+AC_CHECK_DECL([basename(char *)])
address@hidden example
 
 This macro caches its result in the @address@hidden
 variable, with characters not suitable for a variable name mapped to
@@ -6289,7 +6295,8 @@ underscores.
 @acindex{CHECK_DECLS}
 @cvindex address@hidden
 @caindex address@hidden
-For each of the @var{symbols} (@emph{comma}-separated list), define
+For each of the @var{symbols} (@emph{comma}-separated list with optional
+function argument types for C++ overloads), define
 @address@hidden (in all capitals) to @samp{1} if
 @var{symbol} is declared, otherwise to @samp{0}.  If
 @var{action-if-not-found} is given, it is additional shell code to
@@ -6306,6 +6313,7 @@ AC_CHECK_DECLS([strdup])
 AC_CHECK_DECLS([strlen])
 AC_CHECK_DECLS([malloc, realloc, calloc, free])
 AC_CHECK_DECLS([j0], [], [], [[#include <math.h>]])
+AC_CHECK_DECLS([[basename(char *)], [dirname(char *)]])
 @end example
 
 Unlike the other @samp{AC_CHECK_*S} macros, when a @var{symbol} is not
diff --git a/lib/autoconf/general.m4 b/lib/autoconf/general.m4
index b7ac62f..762a56c 100644
--- a/lib/autoconf/general.m4
+++ b/lib/autoconf/general.m4
@@ -2792,10 +2792,16 @@ AC_DEFUN([AC_CHECK_FILES],
 # Shell function body for AC_CHECK_DECL.
 m4_define([_AC_CHECK_DECL_BODY],
 [  AS_LINENO_PUSH([$[]1])
-  AC_CACHE_CHECK([whether $[]2 is declared], [$[]3],
+  [as_decl_name=`echo $][2|sed 's/ *(.*//'`]
+  [as_decl_use=`echo $][2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`]
+  AC_CACHE_CHECK([whether $as_decl_name is declared], [$[]3],
   [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$[]4],
address@hidden:@ifndef $[]2
-  (void) $[]2;
address@hidden:@ifndef $[]as_decl_name
address@hidden:@ifdef __cplusplus
+  (void) $[]as_decl_use;
address@hidden:@else
+  (void) $[]as_decl_name;
address@hidden:@endif
 @%:@endif
 ])],
                   [AS_VAR_SET([$[]3], [yes])],
@@ -2831,7 +2837,8 @@ AS_VAR_POPDEF([ac_Symbol])dnl
 # ACTION-IF-FOUND or ACTION-IF-NOT-FOUND.
 m4_define([_AC_CHECK_DECLS],
 [AC_CHECK_DECL([$1], [ac_have_decl=1], [ac_have_decl=0], [$4])]dnl
-[AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_DECL_$1]), [$ac_have_decl],
+[AC_DEFINE_UNQUOTED(AS_TR_CPP(m4_bpatsubst(HAVE_DECL_[$1],[ *(.*])),
+  [$ac_have_decl],
   [Define to 1 if you have the declaration of `$1',
    and to 0 if you don't.])]dnl
 [m4_ifvaln([$2$3], [AS_IF([test $ac_have_decl = 1], [$2], [$3])])])
diff --git a/tests/semantics.at b/tests/semantics.at
index bb4481b..b703fd4 100644
--- a/tests/semantics.at
+++ b/tests/semantics.at
@@ -109,9 +109,40 @@ AT_CHECK_MACRO([AC_CHECK_DECLS],
                   struct { int x[20]; } mystruct;
                   extern int myfunc();
                   #define mymacro1(arg) arg
-                  #define mymacro2]])]],
+                  #define mymacro2]])
+  # The difference in space-before-open-paren is intentional.
+  AC_CHECK_DECLS([basenam (char *), dirnam(char *),
+                 [moreargs (char, short, int, long, void *, char [], float, 
double)]],,,
+                [[#ifdef __cplusplus
+                  extern "C++" char *basenam (char *);
+                  extern "C++" const char *basenam (const char *);
+                  #else
+                  extern char *basenam (const char *);
+                  #endif
+                  #ifdef __cplusplus
+                  extern "C" {
+                  #endif
+                  extern int moreargs (char, short, int, long, void *,
+                                       char [], float, double);
+                  #ifdef __cplusplus
+                  }
+                  #endif
+                  ]])
+  AC_CHECK_DECL([declared (char *)],, [AS_EXIT([1])],
+               [[#ifdef __cplusplus
+                 extern "C++" char *declared (char *);
+                 extern "C++" const char *declared (const char *);
+                 #else
+                 extern char *declared (const char *);
+                 #endif
+               ]])
+  AC_CHECK_DECL([undeclared (char *)], [AS_EXIT([1])],, [[]])
+]],
 [AT_CHECK_DEFINES(
-[#define HAVE_DECL_MYENUM 1
+[#define HAVE_DECL_BASENAM 1
+#define HAVE_DECL_DIRNAM 0
+#define HAVE_DECL_MOREARGS 1
+#define HAVE_DECL_MYENUM 1
 #define HAVE_DECL_MYFUNC 1
 #define HAVE_DECL_MYMACRO1 1
 #define HAVE_DECL_MYMACRO2 1


hooks/post-receive
-- 
GNU Autoconf source repository



reply via email to

[Prev in Thread] Current Thread [Next in Thread]