Closed adamws closed 4 months ago
Note - the same situation exists with mac/include/config.h
. That all seems to be obsolete though, ever since MacOSX was released.
Ideally autoconf should test if __attribute__
is supported by the compiler. There used to be a test for this, but it was removed in 2e4af8049fd397f618d55142cea4774af404c6e8 because redefining __attribute__
would break libc.
The correct fix would be to replace all uses of __attribute__
in the source with a Cyrus-SASL specific macro, so we can define it at will without affecting any other libraries. That's rather invasive but I think it's the right way to go. Also instead of the obsolete CMU-specific test, we can use autoconf's own test https://www.gnu.org/software/autoconf-archive/ax_c___attribute__.html
The
saslplug.h
header uses__attribute__
which is not handled by msvc:https://github.com/cyrusimap/cyrus-sasl/blob/ef0bafd15f5a541033c673e0e68993b07c16147a/include/saslplug.h#L107
I suppose this is why this exist:
https://github.com/cyrusimap/cyrus-sasl/blob/ef0bafd15f5a541033c673e0e68993b07c16147a/win32/include/config.h#L137-L138
The problem is that
config.h
is not part of installation andsaslplug.h
is, meaning that when packaged withconan
for example, msvc users would get header which is not immediately usable. I tested that by downloading cyrus-sasl from conancenter:and checking how it is packaged:
I think that there is a room for improvement here, i.e. public headers should contain platform-specific attribute handling.