]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
app.h: Restore C++ compatibility for macro AST_DECLARE_APP_ARGS
authorJaco Kroon <jaco@uls.co.za>
Wed, 10 Feb 2021 17:59:01 +0000 (19:59 +0200)
committerGeorge Joseph <gjoseph@digium.com>
Tue, 23 Feb 2021 19:39:36 +0000 (13:39 -0600)
This partially reverts commit 3d1bf3c537bba0416f691f48165fdd0a32554e8a,
specifically for app.h.

This works with both gcc 9.3.0 and 10.2.0 now, both for C and C++ (as
tested with external modules).

ASTERISK-29287

Change-Id: I5b9f02a9b290675682a1d13f1788fdda597c9fca
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
include/asterisk/app.h

index 91d06aace8d6c35cf04aeaf9a19cc6f2bda8029f..6323287fccc7db32f896aaa4c966d3b439d238c2 100644 (file)
@@ -1235,10 +1235,8 @@ int ast_app_group_list_unlock(void);
 #define AST_DEFINE_APP_ARGS_TYPE(type, arglist) \
        struct type { \
                unsigned int argc; \
-               union { \
-                       char *argv[sizeof(struct {arglist}) / sizeof(char *)]; \
-                       struct {arglist}; \
-               }; \
+               char *argv[0]; \
+               arglist; \
        }
 
 /*!