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

Fix include xlocale #3699

Closed

Conversation

hotwatermorning
Copy link
Contributor

@hotwatermorning hotwatermorning commented Nov 2, 2023

I use fmtlib's fmt on some console game development environment, but os.h doesn't compile because of missing of xlocale.h.

Therefore I added __has_include() check before including xlocale.h.

Thanks.

include/fmt/os.h Outdated
@@ -14,7 +14,9 @@
#include <system_error> // std::system_error

#if defined __APPLE__ || defined(__FreeBSD__)
# include <xlocale.h> // for LC_NUMERIC_MASK on OS X
# if (__cplusplus < 201703L) || __has_include(<xlocale.h>)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use FMT_HAS_INCLUDE(<xlocale.h>) instead of these checks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vitaut Hi, I changed the code to use FMT_HAS_INCLUDE and rebased on origin's master.

Copy link
Contributor

@vitaut vitaut left a comment

Choose a reason for hiding this comment

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

Thanks for the PR

@vitaut
Copy link
Contributor

vitaut commented Nov 3, 2023

Merged with a minor tweak, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants