Skip to content
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

Do not set feature test macro in public header #320

Merged
merged 5 commits into from
Aug 8, 2023
Merged

Conversation

horgh
Copy link
Contributor

@horgh horgh commented Aug 4, 2023

No description provided.

@horgh horgh force-pushed the horgh/posix branch 2 times, most recently from f51c9c9 to 026efa9 Compare August 4, 2023 21:51
We believe that this should be set by applications rather than by the
library. The spec suggests that having it in this spot is not correct as
it should be set prior to any header being included. See
https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_02.

Fixes #318
Copy link
Member

@oschwald oschwald left a comment

Choose a reason for hiding this comment

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

One optional improvement. This or even an internal header throughout might be a bit cleaner, but I don't have strong opinion.

Do you think we will need to update any of our extensions for this change? If so, we should be sure to release those before we release this.

@@ -1,5 +1,8 @@
// This test currently does not work on Windows as nftw is
// not available.
#ifndef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200809L
#endif
Copy link
Member

Choose a reason for hiding this comment

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

It doesn't matter too much, but could we have just set these in maxminddb_test_helper.h?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we could. The reason I didn't is the spec says we should be setting them prior to including any header. I suppose it is fine to do that though given it's test code!

@horgh
Copy link
Contributor Author

horgh commented Aug 8, 2023

I tested the Python, PHP, and Perl extensions with this version of libmaxminddb installed. I ran the tests as shown in the GitHub test action for each. All ran without issue, so I think we're okay with the extensions as they are.

@horgh
Copy link
Contributor Author

horgh commented Aug 8, 2023

Console output of the tests - https://gist.github.com/horgh/f6c8b7a5ba3b042fcccb4111481bf214

@oschwald oschwald merged commit 83758e5 into main Aug 8, 2023
29 checks passed
@oschwald oschwald deleted the horgh/posix branch August 8, 2023 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants