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

_pipe not available on UWP #1385

Closed
TheBlackOne opened this issue Oct 31, 2019 · 4 comments
Closed

_pipe not available on UWP #1385

TheBlackOne opened this issue Oct 31, 2019 · 4 comments

Comments

@TheBlackOne
Copy link

TheBlackOne commented Oct 31, 2019

Hey!

I am working in adding {fmt} to a project that compiles for UWP. Unfortunately, compiling for UWP fails:
C:\[omitted]\fmt\6.0.0\src\posix.cc(198): error C2039: '_pipe': is not a member of 'global namespace'

It would seem that _pipe is not available on UWP at all, and no workaround available: https://docs.microsoft.com/en-us/cpp/cppcx/crt-functions-not-supported-in-universal-windows-platform-apps?view=vs-2019

While I understand that UWP is not a popular platform to begin with, this is a showstopper on bringing the project I am working for forward in regards of string formatting and being proactive of preparing for C++20.

@TheBlackOne
Copy link
Author

TheBlackOne commented Oct 31, 2019

I believe the problem stems from here:

if (WIN32)
  check_symbol_exists(open io.h HAVE_OPEN)
...
if (HAVE_OPEN)
  add_headers(FMT_HEADERS posix.h)
  set(FMT_SOURCES ${FMT_SOURCES} src/posix.cc)

https://github.com/fmtlib/fmt/blob/master/CMakeLists.txt#L138
https://github.com/fmtlib/fmt/blob/master/CMakeLists.txt#L158

That check succeeds on UWP, as _open exists there. However, other CRT functions that are called in posix.cc do not (like the aforementioned _pipe), so the check for _open only does not embrace the whole situation.

@vitaut
Copy link
Contributor

vitaut commented Nov 1, 2019

It's just a matter of adding another check similar to the one for open in CMake. Could you submit a PR since you in the best position to test it?

vitaut added a commit that referenced this issue Nov 13, 2019
@vitaut
Copy link
Contributor

vitaut commented Nov 17, 2019

Tentatively fixed in 9b7fe2a. If this doesn't help please submit a PR adjusting the UWP check in

(!defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP))
.

@vitaut vitaut closed this as completed Nov 17, 2019
@TheBlackOne
Copy link
Author

Ah sorry, I could not engage with this one sooner.
Thanks for looking into it, I really appreciate it.

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

No branches or pull requests

2 participants