diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-07-28 22:50:54 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-07-28 22:50:54 +0000 |
commit | 3ffb23720d9c16ec413ea4871f7a4728f073235a (patch) | |
tree | 5f749b5e10f9b615d385efd401bd3ef745840c9f /include | |
parent | 173525f1d66d38e2f83ebbda4c3778c7007850b6 (diff) |
add macros for the pure and const attributes to compiler.h, in case they ever
need to be handled differently for a specific compiler
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38454 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/channel.h | 7 | ||||
-rw-r--r-- | include/asterisk/compiler.h | 4 |
2 files changed, 8 insertions, 3 deletions
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h index 1af18717e..f60738cc3 100644 --- a/include/asterisk/channel.h +++ b/include/asterisk/channel.h @@ -116,6 +116,7 @@ extern "C" { #include "asterisk/utils.h" #include "asterisk/linkedlists.h" #include "asterisk/stringfields.h" +#include "asterisk/compiler.h" #define AST_MAX_FDS 8 @@ -955,14 +956,14 @@ int ast_channel_masquerade(struct ast_channel *original, struct ast_channel *clo * Give a name to a cause code * Returns the text form of the binary cause code given */ -const char *ast_cause2str(int state) __attribute__ ((pure)); +const char *ast_cause2str(int state) attribute_pure; /*! Convert the string form of a cause code to a number */ /*! * \param name string form of the cause * Returns the cause code */ -int ast_str2cause(const char *name) __attribute__ ((pure)); +int ast_str2cause(const char *name) attribute_pure; /*! Gives the string form of a given channel state */ /*! @@ -979,7 +980,7 @@ char *ast_state2str(int state); * See above * Returns the text form of the binary transfer capbility */ -char *ast_transfercapability2str(int transfercapability) __attribute__ ((const)); +char *ast_transfercapability2str(int transfercapability) attribute_const; /* Options: Some low-level drivers may implement "options" allowing fine tuning of the low level channel. See frame.h for options. Note that many channel drivers may support diff --git a/include/asterisk/compiler.h b/include/asterisk/compiler.h index 24f6907d1..b8df362e1 100644 --- a/include/asterisk/compiler.h +++ b/include/asterisk/compiler.h @@ -30,4 +30,8 @@ #define force_inline inline __attribute__((always_inline)) #endif +#define attribute_pure __attribute__((pure)) + +#define attribute_const __attribute__((const)) + #endif /* _ASTERISK_COMPILER_H */ |