From 38f6e5d1ad42dfbf132f4f4a4660c7416e50669e Mon Sep 17 00:00:00 2001 From: Richard Mudgett <rmudgett@digium.com> Date: Mon, 5 Mar 2012 21:55:28 +0000 Subject: [PATCH] Make usage of DECLARE_STRINGFIELD_SETTERS_FOR() not look so odd. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358263 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- include/asterisk/channel.h | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index c0ff89d865..7b3a1443e1 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -2145,7 +2145,7 @@ int ast_channel_setoption(struct ast_channel *channel, int option, void *data, i * * \param capabilities to pick best codec out of * \param result stucture to store the best codec in. - * \retval on success, pointer to result structure + * \retval on success, pointer to result structure * \retval on failure, NULL */ struct ast_format *ast_best_codec(struct ast_format_cap *cap, struct ast_format *result); @@ -3656,23 +3656,24 @@ void ast_channel_unlink(struct ast_channel *chan); /*! \brief Set the channel name */ void ast_channel_name_set(struct ast_channel *chan, const char *name); -#define DECLARE_STRINGFIELD_SETTERS_FOR(field) void ast_channel_##field##_set(struct ast_channel *chan, const char *field); \ -void ast_channel_##field##_build_va(struct ast_channel *chan, const char *fmt, va_list ap) __attribute__((format(printf, 2, 0))); \ -void ast_channel_##field##_build(struct ast_channel *chan, const char *fmt, ...) __attribute__((format(printf, 2, 3))); - -DECLARE_STRINGFIELD_SETTERS_FOR(name) -DECLARE_STRINGFIELD_SETTERS_FOR(language) -DECLARE_STRINGFIELD_SETTERS_FOR(musicclass) -DECLARE_STRINGFIELD_SETTERS_FOR(accountcode) -DECLARE_STRINGFIELD_SETTERS_FOR(peeraccount) -DECLARE_STRINGFIELD_SETTERS_FOR(userfield) -DECLARE_STRINGFIELD_SETTERS_FOR(call_forward) -DECLARE_STRINGFIELD_SETTERS_FOR(uniqueid) -DECLARE_STRINGFIELD_SETTERS_FOR(linkedid) -DECLARE_STRINGFIELD_SETTERS_FOR(parkinglot) -DECLARE_STRINGFIELD_SETTERS_FOR(hangupsource) -DECLARE_STRINGFIELD_SETTERS_FOR(dialcontext) - +#define DECLARE_STRINGFIELD_SETTERS_FOR(field) \ + void ast_channel_##field##_set(struct ast_channel *chan, const char *field); \ + void ast_channel_##field##_build_va(struct ast_channel *chan, const char *fmt, va_list ap) __attribute__((format(printf, 2, 0))); \ + void ast_channel_##field##_build(struct ast_channel *chan, const char *fmt, ...) __attribute__((format(printf, 2, 3))) + +DECLARE_STRINGFIELD_SETTERS_FOR(name); +DECLARE_STRINGFIELD_SETTERS_FOR(language); +DECLARE_STRINGFIELD_SETTERS_FOR(musicclass); +DECLARE_STRINGFIELD_SETTERS_FOR(accountcode); +DECLARE_STRINGFIELD_SETTERS_FOR(peeraccount); +DECLARE_STRINGFIELD_SETTERS_FOR(userfield); +DECLARE_STRINGFIELD_SETTERS_FOR(call_forward); +DECLARE_STRINGFIELD_SETTERS_FOR(uniqueid); +DECLARE_STRINGFIELD_SETTERS_FOR(linkedid); +DECLARE_STRINGFIELD_SETTERS_FOR(parkinglot); +DECLARE_STRINGFIELD_SETTERS_FOR(hangupsource); +DECLARE_STRINGFIELD_SETTERS_FOR(dialcontext); + const char *ast_channel_name(const struct ast_channel *chan); const char *ast_channel_language(const struct ast_channel *chan); const char *ast_channel_musicclass(const struct ast_channel *chan); -- GitLab