+Fri Jan 21 10:18:24 2000 Owen Taylor <otaylor@redhat.com>
+
+ * glib.h (G_N_ELEMENTS): Added G_N_ELEMENTS macro to determine
+ the number of elements in an array.
+
Sun Jan 9 13:28:36 2000 Tim Janik <timj@gtk.org>
* gstrfuncs.c (g_strtod): correctly fetch the current locale,
+Fri Jan 21 10:18:24 2000 Owen Taylor <otaylor@redhat.com>
+
+ * glib.h (G_N_ELEMENTS): Added G_N_ELEMENTS macro to determine
+ the number of elements in an array.
+
Sun Jan 9 13:28:36 2000 Tim Janik <timj@gtk.org>
* gstrfuncs.c (g_strtod): correctly fetch the current locale,
+Fri Jan 21 10:18:24 2000 Owen Taylor <otaylor@redhat.com>
+
+ * glib.h (G_N_ELEMENTS): Added G_N_ELEMENTS macro to determine
+ the number of elements in an array.
+
Sun Jan 9 13:28:36 2000 Tim Janik <timj@gtk.org>
* gstrfuncs.c (g_strtod): correctly fetch the current locale,
+Fri Jan 21 10:18:24 2000 Owen Taylor <otaylor@redhat.com>
+
+ * glib.h (G_N_ELEMENTS): Added G_N_ELEMENTS macro to determine
+ the number of elements in an array.
+
Sun Jan 9 13:28:36 2000 Tim Janik <timj@gtk.org>
* gstrfuncs.c (g_strtod): correctly fetch the current locale,
+Fri Jan 21 10:18:24 2000 Owen Taylor <otaylor@redhat.com>
+
+ * glib.h (G_N_ELEMENTS): Added G_N_ELEMENTS macro to determine
+ the number of elements in an array.
+
Sun Jan 9 13:28:36 2000 Tim Janik <timj@gtk.org>
* gstrfuncs.c (g_strtod): correctly fetch the current locale,
+Fri Jan 21 10:18:24 2000 Owen Taylor <otaylor@redhat.com>
+
+ * glib.h (G_N_ELEMENTS): Added G_N_ELEMENTS macro to determine
+ the number of elements in an array.
+
Sun Jan 9 13:28:36 2000 Tim Janik <timj@gtk.org>
* gstrfuncs.c (g_strtod): correctly fetch the current locale,
+Fri Jan 21 10:18:24 2000 Owen Taylor <otaylor@redhat.com>
+
+ * glib.h (G_N_ELEMENTS): Added G_N_ELEMENTS macro to determine
+ the number of elements in an array.
+
Sun Jan 9 13:28:36 2000 Tim Janik <timj@gtk.org>
* gstrfuncs.c (g_strtod): correctly fetch the current locale,
+Fri Jan 21 10:18:24 2000 Owen Taylor <otaylor@redhat.com>
+
+ * glib.h (G_N_ELEMENTS): Added G_N_ELEMENTS macro to determine
+ the number of elements in an array.
+
Sun Jan 9 13:28:36 2000 Tim Janik <timj@gtk.org>
* gstrfuncs.c (g_strtod): correctly fetch the current locale,
#define G_STRINGIFY(macro_or_string) G_STRINGIFY_ARG (macro_or_string)
#define G_STRINGIFY_ARG(contents) #contents
+/* Count the number of elements in an array. The array must be defined
+ * as such; using this with a dynamically allocated array will give
+ * incorrect results.
+ */
+#define G_N_ELEMENTS(arr) (sizeof(arr) / sizeof((arr)[0]))
/* Define G_VA_COPY() to do the right thing for copying va_list variables.
* glibconfig.h may have already defined G_VA_COPY as va_copy or __va_copy.
#define G_STRINGIFY(macro_or_string) G_STRINGIFY_ARG (macro_or_string)
#define G_STRINGIFY_ARG(contents) #contents
+/* Count the number of elements in an array. The array must be defined
+ * as such; using this with a dynamically allocated array will give
+ * incorrect results.
+ */
+#define G_N_ELEMENTS(arr) (sizeof(arr) / sizeof((arr)[0]))
/* Define G_VA_COPY() to do the right thing for copying va_list variables.
* glibconfig.h may have already defined G_VA_COPY as va_copy or __va_copy.