-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
roaring/portability.h
leads to build errors on MacOS when used with other libraries
#690
Comments
.. another data point that might be of interest: Defining
|
Do you think that it is feasible? If so, that would be fantastic… |
After looking into this a little bit, can I ask what the original reason was for defining the As I currently see two options when it is still desired:
|
Note the following guidance (also for the
https://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html |
I have no idea what these macros do. I have tried removing the xopen source thing here: #695 |
Great! Thank you! Then it could be noted that the definition of
However, this has not caused me any errors and I am not sure whether this enables necessary features from system headers. |
@Taepper Can you explain how we violate the rule that you quote? I don't see it. |
which always defines
The manual specifies, that:
While the macro is the first thing in the file Take this file as an example: https://github.com/RoaringBitmap/CRoaring/blob/master/include/roaring/containers/array.h It will define
|
I detect this error on roaring version 4.2.1, but also in older versions.
roaring/portability.h
contains the following code:This leads to problems on MacOS when including both header files from roaring and also including header files from other libraries. In my case this happens when including
roaring
beforeasio
.The following code simple test program leads to errors:
Even undefining
_XOPEN_SOURCE
does not remedy the situation:as
roaring
already included system header files (in this case<netdb.h>
,<netinet/in.h>
), whose definitions are expected byasio.hpp
.This fixes this particular instance:
To circumvent such issues in the future, maybe the portability header should only be included in either test builds or in object files? I am happy to contribute changes
Here are some further links describing similar issues and discussions thereof:
kcat/openal-soft#4
https://lwn.net/Articles/540831/
The text was updated successfully, but these errors were encountered: