diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-01-25 02:52:32 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-01-25 02:52:32 +0000 |
commit | a36facc95de54b353ee76b9b58df14bfcecd4236 (patch) | |
tree | e3223cf7c29e121a2df2394b62f4c2759c12eafd /include | |
parent | e80767e65cf69f816d9075355d6530a332bae40a (diff) |
Merged revisions 170943 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r170943 | russell | 2009-01-24 20:49:30 -0600 (Sat, 24 Jan 2009) | 6 lines
Change ARRAY_LEN() to be more C++ safe.
When the second part of this macro is written as 0[a] instead of a[0], it will
force a failure if the macro is used on a C++ object that overloads the []
operator.
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@170945 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/utils.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/asterisk/utils.h b/include/asterisk/utils.h index 941b5e57a..ee8bbd511 100644 --- a/include/asterisk/utils.h +++ b/include/asterisk/utils.h @@ -657,7 +657,7 @@ void ast_enable_packet_fragmentation(int sock); */ int ast_mkdir(const char *path, int mode); -#define ARRAY_LEN(a) (sizeof(a) / sizeof(a[0])) +#define ARRAY_LEN(a) (sizeof(a) / sizeof(0[a])) #ifdef AST_DEVMODE #define ast_assert(a) _ast_assert(a, # a, __FILE__, __LINE__, __PRETTY_FUNCTION__) |