diff options
author | Bruno Haible <bruno@clisp.org> | 2016-11-20 13:24:27 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2016-11-22 00:26:09 +0100 |
commit | 6b26660a01125acb394e39ac71635c8df4c110c4 (patch) | |
tree | 32cc4c391faa5e4ebd85762cf619693aab10629a /build-aux | |
parent | 60e8ffca02dd4eac3a87b744f4f9ef68f3dffa35 (diff) | |
download | gnulib-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.
Diffstat (limited to 'build-aux')
-rw-r--r-- | build-aux/snippet/c++defs.h | 40 |
1 files changed, 25 insertions, 15 deletions
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 |