On 19 Nov 2017, at 0.40, Jan Engelhardt jengelh@inai.de wrote:
Making third-party plugins for Dovecot is really hard and frustrating. Using dovecot 2.2.33.2 and the following sources, the compile errors keep coming. The use of g++ is mandated as the underlying backend this plugin will access only has a C++ interface.
See compile instructions for example here: https://dovecot.org/patches/2.2/imap-logout-plugin.c https://dovecot.org/patches/2.2/imap-logout-plugin.c
== Problems 2 In file included from /usr/include/bits/byteswap.h:35:0, from /usr/include/byteswap.h:24, from a.cpp:2: /usr/include/dovecot/byteorder.h:32:24: error: expected unqualified-id before ‘__extension__’ static inline uint16_t bswap_16(uint16_t in);
Try #undef bswap_16 (and others)? We have a patch pending that does these #undefs to fix compiling issue with uclibc-ng - maybe a similar problem.
== Other problems dovecot headers files are missing 'extern "C"' lines. This means the linkage of symbols like dev_null_fd is not what it should be. I can't use extern "C" { #include
} either because then the standardy library headers that are included by dovecot headers can easily start acting up too.
lucene-wrapper.cc seems to compile fine with this..