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

fmt incompatible with C++/CLI? #2285

Closed
pdxcodemonkey opened this issue May 13, 2021 · 2 comments
Closed

fmt incompatible with C++/CLI? #2285

pdxcodemonkey opened this issue May 13, 2021 · 2 comments

Comments

@pdxcodemonkey
Copy link

I have a library built using C++/CLI to talk to a C++ layer, and it blows up if I include format.h. The following define is causing the issue:

  #if FMT_MSC_VER && !defined(FMT_BUILTIN_CLZLL) && \
    !defined(FMT_BUILTIN_CTZLL) && !defined(_MANAGED)

Here _MANAGED is true, causing the block to be skipped and the inline versions of ctz and ctzll not to be defined. Compilation then fails in this block of format_inl.h:

#ifdef FMT_BUILTIN_CTZ
  int t = FMT_BUILTIN_CTZ(n);
#else
  int t = ctz(n);
#endif

And again here:

#ifdef FMT_BUILTIN_CTZLL
  int t = FMT_BUILTIN_CTZLL(n);
#else
  int t = ctzll(n);
#endif

because FMT_BUILTIN_CTZ et al are undefined, but there is also no intrinsic ctz or ctzll on the platform.

Is this by design, or just a bug?

@vitaut
Copy link
Contributor

vitaut commented May 13, 2021

C++/CLI is not actively supported but I'm open to a PR to fix this issue, provided that the fix is non-intrusive.

@vitaut vitaut closed this as completed May 13, 2021
@Brainy0207
Copy link
Contributor

I hope it's ok to comment on a closed issue.
I just wanted to mention, that this issue is already fixed in master: #2176

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

No branches or pull requests

3 participants