changeset 38200:e6f5abf51e32

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.
author Bruno Haible <bruno@clisp.org>
date Sun, 20 Nov 2016 13:24:27 +0100
parents 632bf6c3a968
children 78d05a194099
files ChangeLog build-aux/snippet/c++defs.h
diffstat 2 files changed, 33 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Nov 20 20:16:29 2016 -0800
+++ b/ChangeLog	Sun Nov 20 13:24:27 2016 +0100
@@ -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
--- a/build-aux/snippet/c++defs.h	Sun Nov 20 20:16:29 2016 -0800
+++ b/build-aux/snippet/c++defs.h	Sun Nov 20 13:24:27 2016 +0100
@@ -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