-
Notifications
You must be signed in to change notification settings - Fork 99
universal-windows: Port to winrt #17
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
Conversation
@@ -378,7 +396,11 @@ inline _fi_find_handle find_first_file(const char* wild, _fi_find_data& data) | |||
if (::MultiByteToWideChar(CP_ACP, 0, wild, wild_size, wide_wild, wild_size + 1) == 0) | |||
return _fi_invalid_handle; | |||
|
|||
# if BOOST_PLAT_WINDOWS_RUNTIME | |||
return FindFirstFileExW(wide_wild, FindExInfoStandard, &data, FindExSearchNameMatch, NULL, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the MSDN library documentation, FindFirstFileExW is available in Windows XP and Server 2003, so maybe it can be used unconditionally (like in your filesystem pull request)?
And the boost/predef/platform.h include for the BOOST_PLAT_* macros seems to be missing, also in your filesystem and test pull requests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(thanks for the review: @MarcelRaad )
I will switch to unconditionally use FindFirstFileExW.
As it were boost.predef was being pulled in by something else which is the reason why it worked. I guess it is ok to add a dependency to boost.predef?
@MarcelRaad care to take another look? |
Looks good to me! |
e6c49b8
to
80ada9f
Compare
@MarcelRaad I just pushed a fixed version which re-enables boost::wregex again. |
Thanks for the patches, will investigate shortly. |
@jzmaddock thanks |
I still see errors when building for windows store with msvc-14.0:
|
@jzmaddock I think you need this in your local boost.config: boostorg/config#80 sorry for not mentioning. |
Nope, still get:
And this page: https://msdn.microsoft.com/en-gb/library/windows/desktop/aa366537%28v=vs.85%29.aspx suggests it's a desktop only API. The headers seem to confirm that as it's declared inside a #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) block. Given that your patch disables w32_regex_traits anyway, and the only reason for using the Windows API in fileiter.cpp is to use memory mapped files, there would seem to be a much simpler patch that just involves setting BOOST_REGEX_NO_W32 in regex/config.hpp ?? |
Ok sorry for wasting your time like this. I will investigate as soon as I have had dinner and spent some time with my kids. |
The use of LCID is deprecated since Vista (but still available). Also LoadString() is not available at all when targeting winrt so the w32_regex_traits will need a larger rewrite. Fall back to cpp_regex_traits for now.
Just as on VC10 this causes linker errors with std::collate<unsigned short>::id.
@jzmaddock ok I just tested again:
I think the problem might have been that my local versions were too old, I have therefore rebase mauve/winrt-fileiter on the latest origin/develop and repushed to this PR again. Again sorry if I wasted your time. |
Works for me too, it's defined in memoryapi.h from the Windows 10 SDK, even when building for Windows 8.0 or 8.1. Perhaps you're using the Windows 8.1 SDK @jzmaddock ? There it's only defined for WINAPI_PARTITION_DESKTOP. If installed, the Windows 10 SDK should be the default one when building from the command line. |
it compiles for me even if I compile with |
I have now verified on a fresh install, in order for this to build you need to have the windows 10 sdk but given that we have set _WIN32_WINNT to 0x0602, the produced binary should still work on windows 8:
@jzmaddock how do you want to proceed? is it ok to require the windows 10 sdk for building? |
I realise it didn't build before so we're not breaking anything by OK, lets think a little... the only difference between this approach and |
@jzmaddock ok I didn't know that fileiter was only used by deprecated code, in that case it makes sense to just define BOOST_REGEX_NO_W32 when targeting windows store. I will whip-up a patch. |
New try: #18 |
This makes fileiter.cpp compile when targeting universal windows (b2 windows-api=store) I still need to port w32_regex_traits for the entire library to build so this PR can wait but I thought I could push it as soon as possible to gather feedback.
UPDATE: everything compiles. w32_regex_traits has been ifdeffed-out though (see commit-message)