]> Savannah Git Hosting - gnulib.git/commitdiff
snippet/c++defs: Simplify _GL_CXXALIAS_* macros.
authorBruno Haible <bruno@clisp.org>
Sun, 20 Nov 2016 12:24:27 +0000 (13:24 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 21 Nov 2016 23:26:09 +0000 (00:26 +0100)
* 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.

ChangeLog
build-aux/snippet/c++defs.h

index fbdecf003d922a435bdabcef296551800e06d61b..75070316c2d50f6f34dd0736c2520d1c1a29e1a4 100644 (file)
--- 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
index b19a0befa3d4c9f90d6b99c6541f2de4939c3b63..9cdef025880123bea9387e0f827b652097eba23a 100644 (file)
       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
       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
       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) \
       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
       {                                                                       \
         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