[dovecot-cvs] dovecot/src/lib array.h,1.5,1.6

cras at dovecot.org cras at dovecot.org
Fri Mar 18 19:33:56 EET 2005


Update of /var/lib/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv4528

Modified Files:
	array.h 
Log Message:
ARRAY_SET_TYPE() in non-DEBUG-mode was giving errors with older gccs if it
was used at the beginning of a function (function can't start with ";").



Index: array.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/array.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- array.h	15 Mar 2005 18:58:18 -0000	1.5
+++ array.h	18 Mar 2005 17:33:53 -0000	1.6
@@ -51,8 +51,16 @@
 #else
 #  define ARRAY_DEFINE(name, array_type) name
 #  define ARRAY_CREATE(array, pool, array_type, init_count) \
-	array_create(array, pool, sizeof(array_type), init_count);
-#  define ARRAY_SET_TYPE(array, array_type)
+	array_create(array, pool, sizeof(array_type), init_count)
+/* The reason we do this for non-ARRAY_TYPE_CHECKS as well is because if we
+   left this empty, some compilers wouldn't like an extra ";" character at
+   the beginning of the function (eg. gcc 2.95).
+
+   However just declaring the variable gives "unused variable" warning.
+   I couldn't think of anything better, so we just use gcc-specific
+   unused-attribute to get rid of that with gcc. */
+#  define ARRAY_SET_TYPE(array, array_type) \
+	array_type **array ## __ ## type __attr_unused__ = NULL
 #  define ARRAY_INIT { 0, 0 }
 #endif
 



More information about the dovecot-cvs mailing list