diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-01-24 21:57:41 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-01-24 21:57:41 +0000 |
commit | 411adc3e557aa3ea7d2076efc14ec26af2975725 (patch) | |
tree | 5766b40a24d15ff6092850b2dadcaa3cc13d56f2 /include | |
parent | c085bcb8d453132bfdf0a288c9aef65e2866574e (diff) |
make these macros not assume that the only other field in the structure is 'argc'... this is true when someone uses AST_DECLARE_APP_ARGS, but it's perfectly reasonable to define your own structure as long as it has the right fields
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@100264 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/app.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/asterisk/app.h b/include/asterisk/app.h index fc0536e06..7abff8e53 100644 --- a/include/asterisk/app.h +++ b/include/asterisk/app.h @@ -275,7 +275,7 @@ int ast_app_group_list_unlock(void); the argc argument counter field. */ #define AST_STANDARD_APP_ARGS(args, parse) \ - args.argc = ast_app_separate_args(parse, '|', args.argv, (sizeof(args) - sizeof(args.argc)) / sizeof(args.argv[0])) + args.argc = ast_app_separate_args(parse, '|', args.argv, ((sizeof(args) - offsetof(typeof(args), argv)) / sizeof(args.argv[0]))) /*! \brief Performs the 'nonstandard' argument separation process for an application. @@ -288,7 +288,7 @@ int ast_app_group_list_unlock(void); the argc argument counter field. */ #define AST_NONSTANDARD_APP_ARGS(args, parse, sep) \ - args.argc = ast_app_separate_args(parse, sep, args.argv, (sizeof(args) - sizeof(args.argc)) / sizeof(args.argv[0])) + args.argc = ast_app_separate_args(parse, sep, args.argv, ((sizeof(args) - offsetof(typeof(args), argv)) / sizeof(args.argv[0]))) /*! \brief Separate a string into arguments in an array |