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: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@170944 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Russell Bryant
2009-01-25 02:50:24 +00:00
parent 05b0390b1a
commit d6ff97e30d

View File

@@ -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__)