Change-Id: I5c104dc1f8417ccd3d01faf86e84ccbf89bc3b31
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
ast_app_separate_args() will perform that function before parsing
the arguments.
*/
-#define AST_DECLARE_APP_ARGS(name, arglist) AST_DEFINE_APP_ARGS_TYPE(, arglist) name = { 0, }
+#define AST_DECLARE_APP_ARGS(name, arglist) AST_DEFINE_APP_ARGS_TYPE(argtype_##name, arglist) name = { 0, }
/*!
\brief Define a structure type to hold an application's arguments.
*/
#define AST_DEFINE_APP_ARGS_TYPE(type, arglist) \
+ struct __subtype_##type { arglist }; \
struct type { \
unsigned int argc; \
- char *argv[0]; \
- arglist; \
+ union { \
+ char *argv[sizeof(struct __subtype_##type) / sizeof(char*)]; \
+ struct { arglist }; \
+ }; \
}
/*!