Skip to content

Fix include xlocale - #3699

Closed
hotwatermorning wants to merge 3 commits into
fmtlib:masterfrom
hotwatermorning:fix-include-xlocale
Closed

hotwatermorning wants to merge 3 commits into
fmtlib:masterfrom
hotwatermorning:fix-include-xlocale

Conversation

@hotwatermorning

@hotwatermorning hotwatermorning commented Nov 2, 2023

Copy link
Copy Markdown
Contributor

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.

Comment thread include/fmt/os.h Outdated

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

Copy link
Copy Markdown
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
Copy Markdown
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.

@vitaut vitaut left a comment

Copy link
Copy Markdown
Contributor

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

vitaut commented Nov 3, 2023

Copy link
Copy Markdown
Contributor

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