aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk/utils.h
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-01-25 02:49:30 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-01-25 02:49:30 +0000
commit99c1b6934298b34e5275dcf9f3845c7c6be1d09d (patch)
tree18bb25c4c0a15262bf08f1b4cbfb4b262778c57a /include/asterisk/utils.h
parent82f5ddcd7ccf2c6b78194c1e46787b49e042931b (diff)
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/trunk@170943 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/utils.h')
-rw-r--r--include/asterisk/utils.h2
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__)