changeset 14935:a588b743d695

Add DOVECOT_PREREQ to src/lib/macros.h - convenience macro to test the version of dovecot
author Dennis Schridde <devurandom@gmx.net>
date Sun, 30 Oct 2011 12:39:53 +0100
parents e294e416f5ba
children eece943c7521
files src/lib/macros.h
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib/macros.h	Sun Oct 30 12:23:28 2011 +0100
+++ b/src/lib/macros.h	Sun Oct 30 12:39:53 2011 +0100
@@ -196,4 +196,12 @@
 #define i_unreached() \
 	i_panic("file %s: line %d: unreached", __FILE__, __LINE__)
 
+/* Convenience macros to test the versions of dovecot. */
+#if defined DOVECOT_VERSION_MAJOR && defined DOVECOT_VERSION_MINOR
+#  define DOVECOT_PREREQ(maj, min) \
+          ((DOVECOT_VERSION_MAJOR << 16) + DOVECOT_VERSION_MINOR >= ((maj) << 16) + (min))
+#else
+#  define DOVECOT_PREREQ(maj, min) 0
 #endif
+
+#endif