From: Kevin P. Fleming Date: Thu, 24 Jan 2008 22:01:55 +0000 (+0000) Subject: Merged revisions 100264 via svnmerge from X-Git-Tag: 1.6.0-beta2~2^2~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=25067d32aadf4a3c3e28b1264bdf912a5dd96997;p=thirdparty%2Fasterisk.git Merged revisions 100264 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r100264 | kpfleming | 2008-01-24 15:57:41 -0600 (Thu, 24 Jan 2008) | 2 lines 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: https://origsvn.digium.com/svn/asterisk/trunk@100265 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/include/asterisk/app.h b/include/asterisk/app.h index 5be2366080..db5194bf13 100644 --- a/include/asterisk/app.h +++ b/include/asterisk/app.h @@ -298,7 +298,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. @@ -311,7 +311,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