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 building with clang in header-only mode #348

Merged
merged 1 commit into from Jun 27, 2016
Merged

Fix building with clang in header-only mode #348

merged 1 commit into from Jun 27, 2016

Conversation

ghost
Copy link

@ghost ghost commented Jun 25, 2016

Building under a recent clang compiler causes the use of an extern
template for the BasicData struct. However, the only instantiation of
that structure in format.cc is only done if FMT_HEADER_ONLY is not
defined. This causes the build to fail in C++11 or C++14 mode.
Therefore, only declare the BasicData template as extern if
FMT_HEADER_ONLY is not defined.

Building under a recent clang compiler causes the use of an extern
template for the BasicData struct. However, the only instantiation of
that structure in format.cc is only done if FMT_HEADER_ONLY is not
defined. This causes the build to fail in C++11 or C++14 mode.
Therefore, only declare the BasicData template as extern if
FMT_HEADER_ONLY is not defined.
@ghost
Copy link
Author

ghost commented Jun 25, 2016

Quick note: I'm working with Apple's Clang version 7.3.0. This change allows the code to compile in header-only mode under clang when compiling in either C++11 or C++14 mode. Thanks!

@vitaut vitaut merged commit 44c926d into fmtlib:master Jun 27, 2016
@vitaut
Copy link
Contributor

vitaut commented Jun 27, 2016

Good catch, thanks!

@ghost ghost deleted the fix-clang-extern-header-only branch June 27, 2016 16:53
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.

1 participant