<p>Jean Aunis - Prescom has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/15399">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app.h: Restore C++ compatibility for macro AST_DECLARE_APP_ARGS<br><br>C++ does not support struct definition inside sizeof(). To get around this,<br>AST_DECLARE_APP_ARGS must be given an explicit argument count when compiling<br>for C++.<br><br>ASTERISK-29287<br><br>Change-Id: Ibb299334d527fcd2af2b023fe64925ecece77d6d<br>---<br>M include/asterisk/app.h<br>1 file changed, 15 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/99/15399/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/asterisk/app.h b/include/asterisk/app.h</span><br><span>index 91d06aa..5ddbf4e 100644</span><br><span>--- a/include/asterisk/app.h</span><br><span>+++ b/include/asterisk/app.h</span><br><span>@@ -1215,7 +1215,11 @@</span><br><span> ast_app_separate_args() will perform that function before parsing</span><br><span> the arguments.</span><br><span> */</span><br><span style="color: hsl(120, 100%, 40%);">+#if defined(__cplusplus) || defined(c_plusplus)</span><br><span style="color: hsl(120, 100%, 40%);">+#define AST_DECLARE_APP_ARGS(name, arglist, argcount) AST_DEFINE_APP_ARGS_TYPE(, arglist, argcount) name = { 0, }</span><br><span style="color: hsl(120, 100%, 40%);">+#else</span><br><span> #define AST_DECLARE_APP_ARGS(name, arglist) AST_DEFINE_APP_ARGS_TYPE(, arglist) name = { 0, }</span><br><span style="color: hsl(120, 100%, 40%);">+#endif</span><br><span> </span><br><span> /*!</span><br><span> \brief Define a structure type to hold an application's arguments.</span><br><span>@@ -1231,7 +1235,16 @@</span><br><span> \note This defines a structure type, but does not declare an instance</span><br><span> of the structure. That must be done separately.</span><br><span> */</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(120, 100%, 40%);">+#if defined(__cplusplus) || defined(c_plusplus)</span><br><span style="color: hsl(120, 100%, 40%);">+#define AST_DEFINE_APP_ARGS_TYPE(type, arglist, argcount) \</span><br><span style="color: hsl(120, 100%, 40%);">+ struct type { \</span><br><span style="color: hsl(120, 100%, 40%);">+ unsigned int argc; \</span><br><span style="color: hsl(120, 100%, 40%);">+ union { \</span><br><span style="color: hsl(120, 100%, 40%);">+ char *argv[argcount]; \</span><br><span style="color: hsl(120, 100%, 40%);">+ struct {arglist}; \</span><br><span style="color: hsl(120, 100%, 40%);">+ }; \</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+#else</span><br><span> #define AST_DEFINE_APP_ARGS_TYPE(type, arglist) \</span><br><span> struct type { \</span><br><span> unsigned int argc; \</span><br><span>@@ -1240,6 +1253,7 @@</span><br><span> struct {arglist}; \</span><br><span> }; \</span><br><span> }</span><br><span style="color: hsl(120, 100%, 40%);">+#endif</span><br><span> </span><br><span> /*!</span><br><span> \brief Performs the 'standard' argument separation process for an application.</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/15399">change 15399</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/15399"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ibb299334d527fcd2af2b023fe64925ecece77d6d </div>
<div style="display:none"> Gerrit-Change-Number: 15399 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Jean Aunis - Prescom <jean.aunis@prescom.fr> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>