Description
Some code, such as deprecated, but still useful https://github.com/microsoft/cpprestsdk, define dllimport as nothing which results in a preprocessor error from clang when including zlib.h
, which comes from zlib-ng on recent Fedora systems (mine is 41) later:
In file included from /usr/include/zlib.h:41:
/usr/include/zconf.h:72:120: error: too few arguments provided to function-like macro invocation
72 | #if defined(ZLIB_DLL) && (defined(_WIN32) || (__has_declspec_attribute(dllexport) && __has_declspec_attribute(dllimport)))
This is, of course, due to the fact that __has_declspec_attribute(dllimport)
becomes an invalid expression when dllimport
expands to nothing.
It could be argued that it's cpprestsdk's own fault, but doing this worked for many years and still does on systems not using zlib-ng, so I think it would be nice to make it work with it too. I could make a PR fixing this, but it will be inevitably (as always when dealing with C preprocessor) ugly, so I'd like to know if it would be welcome first, before submitting it.
Please let me know what do you think!
Activity