summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2016-11-20 13:24:27 +0100
committerBruno Haible <bruno@clisp.org>2016-11-22 00:26:09 +0100
commit6b26660a01125acb394e39ac71635c8df4c110c4 (patch)
tree32cc4c391faa5e4ebd85762cf619693aab10629a
parent60e8ffca02dd4eac3a87b744f4f9ef68f3dffa35 (diff)
downloadgnulib-6b26660a01125acb394e39ac71635c8df4c110c4.tar.gz
snippet/c++defs: Simplify _GL_CXXALIAS_* macros.
* build-aux/snippet/c++defs.h [__cplusplus && GNULIB_NAMESPACE] (_GL_CXXALIAS_RPL_1, _GL_CXXALIAS_RPL_CAST_1, _GL_CXXALIAS_SYS, _GL_CXXALIAS_SYS_CAST, _GL_CXXALIAS_SYS_CAST2): Inline and remove member function 'rpl ()' of the wrapper struct.
-rw-r--r--ChangeLog8
-rw-r--r--build-aux/snippet/c++defs.h40
2 files changed, 33 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index fbdecf003d..75070316c2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2016-11-21 Bruno Haible <bruno@clisp.org>
+
+ snippet/c++defs: Simplify _GL_CXXALIAS_* macros.
+ * build-aux/snippet/c++defs.h [__cplusplus && GNULIB_NAMESPACE]
+ (_GL_CXXALIAS_RPL_1, _GL_CXXALIAS_RPL_CAST_1,
+ _GL_CXXALIAS_SYS, _GL_CXXALIAS_SYS_CAST, _GL_CXXALIAS_SYS_CAST2):
+ Inline and remove member function 'rpl ()' of the wrapper struct.
+
2016-11-20 Paul Eggert <eggert@cs.ucla.edu>
dfa: fix logic typo
diff --git a/build-aux/snippet/c++defs.h b/build-aux/snippet/c++defs.h
index b19a0befa3..9cdef02588 100644
--- a/build-aux/snippet/c++defs.h
+++ b/build-aux/snippet/c++defs.h
@@ -133,8 +133,11 @@
static const struct _gl_ ## func ## _wrapper \
{ \
typedef rettype (*type) parameters; \
- inline type rpl () const { return ::rpl_func; } \
- inline operator type () const { return rpl (); } \
+ \
+ inline operator type () const \
+ { \
+ return ::rpl_func; \
+ } \
} func = {}; \
} \
_GL_EXTERN_C int _gl_cxxalias_dummy
@@ -155,9 +158,11 @@
static const struct _gl_ ## func ## _wrapper \
{ \
typedef rettype (*type) parameters; \
- inline type rpl () const \
- { return reinterpret_cast<type>(::rpl_func); } \
- inline operator type () const { return rpl (); } \
+ \
+ inline operator type () const \
+ { \
+ return reinterpret_cast<type>(::rpl_func); \
+ } \
} func = {}; \
} \
_GL_EXTERN_C int _gl_cxxalias_dummy
@@ -183,10 +188,13 @@
static const struct _gl_ ## func ## _wrapper \
{ \
typedef rettype (*type) parameters; \
- inline type rpl () const { return ::func; } \
- inline operator type () const { return rpl (); } \
+ \
+ inline operator type () const \
+ { \
+ return ::func; \
+ } \
} func = {}; \
- } \
+ } \
_GL_EXTERN_C int _gl_cxxalias_dummy
#else
# define _GL_CXXALIAS_SYS(func,rettype,parameters) \
@@ -205,9 +213,11 @@
static const struct _gl_ ## func ## _wrapper \
{ \
typedef rettype (*type) parameters; \
- inline type rpl () const \
- { return reinterpret_cast<type>(::func); } \
- inline operator type () const { return rpl (); }\
+ \
+ inline operator type () const \
+ { \
+ return reinterpret_cast<type>(::func); \
+ } \
} func = {}; \
} \
_GL_EXTERN_C int _gl_cxxalias_dummy
@@ -235,10 +245,10 @@
{ \
typedef rettype (*type) parameters; \
\
- inline type rpl () const \
- { return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); }\
- \
- inline operator type () const { return rpl (); } \
+ inline operator type () const \
+ { \
+ return reinterpret_cast<type>((rettype2 (*) parameters2)(::func)); \
+ } \
} func = {}; \
} \
_GL_EXTERN_C int _gl_cxxalias_dummy