[Asterisk-code-review] app.h: Restore C++ compatibility for macro AST_DECLARE_APP_ARGS (asterisk[16])

Jaco Kroon asteriskteam at digium.com
Mon Feb 22 08:28:24 CST 2021


Jaco Kroon has uploaded this change for review. ( https://gerrit.asterisk.org/c/asterisk/+/15503 )


Change subject: app.h: Restore C++ compatibility for macro AST_DECLARE_APP_ARGS
......................................................................

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 at uls.co.za>
---
M include/asterisk/app.h
1 file changed, 2 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/03/15503/1

diff --git a/include/asterisk/app.h b/include/asterisk/app.h
index 91d06aa..6323287 100644
--- a/include/asterisk/app.h
+++ b/include/asterisk/app.h
@@ -1235,10 +1235,8 @@
 #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; \
 	}
 
 /*!

-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/15503
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: I5b9f02a9b290675682a1d13f1788fdda597c9fca
Gerrit-Change-Number: 15503
Gerrit-PatchSet: 1
Gerrit-Owner: Jaco Kroon <jaco at uls.co.za>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210222/545139dd/attachment.html>


More information about the asterisk-code-review mailing list