pidgin: d1fea663: add an ARRAY_LENGTH macro to find out le...
khc at pidgin.im
khc at pidgin.im
Sun May 10 18:30:28 EDT 2009
-----------------------------------------------------------------
Revision: d1fea663a03e5f80f539918a21f5f36c09a452b8
Ancestor: f9080d0b3274907da710c3d4d85669464e418ba4
Author: khc at pidgin.im
Date: 2009-05-10T22:23:52
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/d1fea663a03e5f80f539918a21f5f36c09a452b8
Modified files:
libpurple/internal.h
ChangeLog:
add an ARRAY_LENGTH macro to find out length of static arrays
-------------- next part --------------
============================================================
--- libpurple/internal.h dbc124585e288c7bdf107fd6594bc5518cda0ee7
+++ libpurple/internal.h 3a629baabf83974b085f126561edb8d19317879d
@@ -256,6 +256,10 @@ type_name##_get_type (void) \
#endif
+#ifndef ARRAY_LENGTH
+#define ARRAY_LENGTH(arr) (sizeof(arr) / sizeof(*arr))
+#endif
+
/* Safer ways to work with static buffers. When using non-static
* buffers, either use g_strdup_* functions (preferred) or use
* g_strlcpy/g_strlcpy directly. */
More information about the Commits
mailing list