From 725eca3bfa166f9af0da6e97c3c76da97da5ccd0 Mon Sep 17 00:00:00 2001
From: Jaco Kroon <jaco@uls.co.za>
Date: Wed, 10 Feb 2021 19:59:01 +0200
Subject: [PATCH] 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 <jaco@uls.co.za>
---
 include/asterisk/app.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

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; \
 	}
 
 /*!
-- 
GitLab