Skip to content

Commit

Permalink
lib: DOVECOT_PREREQ() - Add micro version
Browse files Browse the repository at this point in the history
Nowadays APIs can change between micro versions as well.
  • Loading branch information
sirainen authored and cmouse committed Nov 8, 2021
1 parent cb5968f commit 31c2413
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/lib/macros.h
Expand Up @@ -234,8 +234,10 @@
#endif

/* Convenience macro to test the versions of dovecot. */
#define DOVECOT_PREREQ(maj, min) \
((DOVECOT_VERSION_MAJOR << 16) + DOVECOT_VERSION_MINOR >= ((maj) << 16) + (min))
#define DOVECOT_PREREQ(maj, min, micro) \
((DOVECOT_VERSION_MAJOR << 24) + \
(DOVECOT_VERSION_MINOR << 16) + \
DOVECOT_VERSION_MICRO >= ((maj) << 24) + ((min) << 16) + (micro))

#ifdef __cplusplus
# undef STATIC_ARRAY
Expand Down

1 comment on commit 31c2413

@rpv-tomsk
Copy link

@rpv-tomsk rpv-tomsk commented on 31c2413 Jun 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please provide an example how this macro should be used ?
I want to check, if I compile my plugin with 2.3.17 or 2.3.20.
When answering, please don't forget what 2.3.17 has only two arguments in DOVECOT_PREREQ().

Thanks.

Please sign in to comment.