From: Jaco Kroon Date: Wed, 10 Feb 2021 17:59:01 +0000 (+0200) Subject: app.h: Restore C++ compatibility for macro AST_DECLARE_APP_ARGS X-Git-Tag: 18.3.0-rc1~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=916d5d5e45656ae638352dda7119549e14184e10;p=thirdparty%2Fasterisk.git app.h: Restore C++ compatibility for macro AST_DECLARE_APP_ARGS 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 --- diff --git a/include/asterisk/app.h b/include/asterisk/app.h index 91d06aace8..6323287fcc 100644 --- a/include/asterisk/app.h +++ b/include/asterisk/app.h @@ -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; \ } /*!