Compare commits

...

3 Commits

Author SHA1 Message Date
proplus
af7354f80e Merge branch 'error-reporting' into 'master'
improved error reporting for incorrect pwhash algo values: previously -1 was...

See merge request liberate/trees!15
2023-09-18 14:52:50 +00:00
micah
15f6248299 Merge branch 'DOVECOT_PREREQ-fix' into 'master'
Fixed #29: restore old macro and rename new one

Closes #29

See merge request liberate/trees!16
2023-09-17 14:34:48 +00:00
proplus
bf4d9ee05b Fixed #29: restore old macro and rename new one 2023-09-06 15:35:32 +02:00

View File

@ -49,6 +49,29 @@
__typeof__ (b) _b = (b); \
_a > _b ? _a : _b; })
/* Fix dovecot's broken DOVECOT_PREREQ version detection macro */
#if !defined(DOVECOT_VERSION_MAJOR) || !defined(DOVECOT_PREREQ)
/* Version detection didn't exist before 2.1.16 */
# error "This plugin doesn't work with dovecot version below 2.1.16"
#else
/* DOVECOT_VERSION_MICRO got added in 2.3.18 */
/* In 2.3.18, the macro got broken too, so we use that for detection */
/* see https://github.com/dovecot/core/commit/31c2413 */
# if defined(DOVECOT_VERSION_MICRO)
/* re-define the macro to the old signature */
# undef DOVECOT_PREREQ
# define DOVECOT_PREREQ(maj, min) \
((DOVECOT_VERSION_MAJOR << 16) + \
DOVECOT_VERSION_MINOR >= ((maj) << 16) + (min))
/* if you want to detect micro version too, use this instead */
# define DOVECOT_PREREQ_MICRO(maj, min, micro) \
((DOVECOT_VERSION_MAJOR << 24) + \
(DOVECOT_VERSION_MINOR << 16) + \
DOVECOT_VERSION_MICRO >= \
((maj) << 24) + ((min) << 16) + (micro))
# endif /* defined(DOVECOT_VERSION_MICRO) */
#endif /* !defined(DOVECOT_VERSION_MAJOR) || !defined(DOVECOT_PREREQ) */
extern const unsigned char trees_header[3];
int trees_initialize(void);