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 on MinGW #162

Merged
merged 1 commit into from
May 24, 2024
Merged

Fix building on MinGW #162

merged 1 commit into from
May 24, 2024

Conversation

MehdiChinoune
Copy link
Contributor

No description provided.

@MehdiChinoune MehdiChinoune marked this pull request as draft May 6, 2024 08:45
@abellgithub
Copy link
Collaborator

abellgithub commented May 6, 2024

Can you please describe this change in detail?

@MehdiChinoune
Copy link
Contributor Author

Can you please describe this change in detail?

  • _wopen expects wchar_t* (wstring) arguments but toNative returns char* (string), so use _open instead on MinGW
  • std::filesystem::path couldn't be converted to string, so use path::string
  • the arguments of wmain are wchar_t which couldn't be passed to formNative on MinGW.

@MehdiChinoune MehdiChinoune marked this pull request as ready for review May 6, 2024 16:24
@hobu
Copy link
Collaborator

hobu commented May 9, 2024

This code does not compile cleanly on all platforms we test with continuous integration. Please update it to ✅ on all three platforms before it can be considered for inclusion.

@MehdiChinoune
Copy link
Contributor Author

@hobu I have pushed new changes, consider approving CI run.

@MehdiChinoune
Copy link
Contributor Author

pushed new changes.

@hobu hobu requested a review from abellgithub May 10, 2024 14:58
Copy link
Collaborator

@hobu hobu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please review and merge as you see fit @abellgithub

@@ -129,7 +133,11 @@ std::vector<std::string> directoryList(const std::string& dir)
fs::directory_iterator end;
while (it != end)
{
#ifndef __MINGW32__
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that string() is totally sufficient. The macro tests can go away, along with the utwine::fromNative() call. But this needs to be testsed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

string() doesn't work with MSVC compiler (It asks for wstring())

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will check.

@MehdiChinoune
Copy link
Contributor Author

ping

@abellgithub abellgithub merged commit 0cee044 into hobuinc:main May 24, 2024
3 checks passed
@MehdiChinoune MehdiChinoune deleted the fix-mingw branch May 24, 2024 15:04
nyalldawson pushed a commit to qgis/QGIS that referenced this pull request May 25, 2024
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.

3 participants