summaryrefslogtreecommitdiff
path: root/build-aux
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2010-04-13 20:18:44 +0200
committerSimon Josefsson <simon@josefsson.org>2010-04-13 20:24:59 +0200
commit30748a9bcbfb76460e42ec96b6988ffc69267680 (patch)
tree95459aa136a9213f4cea7b42fa50dcaffb827723 /build-aux
parentd0d9fa436ed1dce70395d477f9b15199b0482bb6 (diff)
downloadgnutls-30748a9bcbfb76460e42ec96b6988ffc69267680.tar.gz
Update gnulib files, fix syntax-check warnings.
Diffstat (limited to 'build-aux')
-rw-r--r--build-aux/c++defs.h18
-rw-r--r--build-aux/warn-on-use.h9
2 files changed, 26 insertions, 1 deletions
diff --git a/build-aux/c++defs.h b/build-aux/c++defs.h
index 31b29c2261..7d710898ec 100644
--- a/build-aux/c++defs.h
+++ b/build-aux/c++defs.h
@@ -126,6 +126,24 @@
_GL_EXTERN_C int _gl_cxxalias_dummy
#endif
+/* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
+ is like _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
+ except that the C function rpl_func may have a slightly different
+ declaration. A cast is used to silence the "invalid conversion" error
+ that would otherwise occur. */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
+ namespace GNULIB_NAMESPACE \
+ { \
+ rettype (*const func) parameters = \
+ reinterpret_cast<rettype(*)parameters>(::rpl_func); \
+ } \
+ _GL_EXTERN_C int _gl_cxxalias_dummy
+#else
+# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
+ _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
/* _GL_CXXALIAS_SYS (func, rettype, parameters);
declares a C++ alias called GNULIB_NAMESPACE::func
that redirects to the system provided function func, if GNULIB_NAMESPACE
diff --git a/build-aux/warn-on-use.h b/build-aux/warn-on-use.h
index 1cd5062d0a..171e599163 100644
--- a/build-aux/warn-on-use.h
+++ b/build-aux/warn-on-use.h
@@ -67,7 +67,10 @@
/* A compiler attribute is available in gcc versions 4.3.0 and later. */
# define _GL_WARN_ON_USE(function, message) \
extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
-
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+/* Verify the existence of the function. */
+# define _GL_WARN_ON_USE(function, message) \
+extern __typeof__ (function) function
# else /* Unsupported. */
# define _GL_WARN_ON_USE(function, message) \
_GL_WARN_EXTERN_C int _gl_warn_on_use
@@ -85,6 +88,10 @@ _GL_WARN_EXTERN_C int _gl_warn_on_use
# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
extern rettype function parameters_and_attributes \
__attribute__ ((__warning__ (msg)))
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+/* Verify the existence of the function. */
+# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
+extern rettype function parameters_and_attributes
# else /* Unsupported. */
# define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
_GL_WARN_EXTERN_C int _gl_warn_on_use