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

Make Crow compile on MacOS #242

Merged
merged 3 commits into from
Oct 23, 2021
Merged

Make Crow compile on MacOS #242

merged 3 commits into from
Oct 23, 2021

Conversation

The-EDev
Copy link
Member

@The-EDev The-EDev commented Oct 10, 2021

Needs some testing (primarily creating a blueprint with a custom static directory)
I'm also not sure if this is the right way to do things, I mainly changed things until the code compiled.

fixes #229

@luca-schlecker
Copy link
Collaborator

luca-schlecker commented Oct 13, 2021

Is there a way to reproduce #229 on Linux or Windows or is it a problem with the Apple C++ Standard Library?
Standard says that operator=(std::initializer_list<value_type> ilist) is defined for std::map and std::unordered_map with value_type = std::pair<const Key, T>.

Edit: Seems like there is no way. It looks like it's specifically a problem with the C++ standard library for Apple.

include/crow/app.h Outdated Show resolved Hide resolved
docs/guides/compression.md Show resolved Hide resolved
luca-schlecker
luca-schlecker previously approved these changes Oct 13, 2021
@The-EDev
Copy link
Member Author

Is there a way to reproduce #229 on Linux or Windows or is it a problem with the Apple C++ Standard Library?

It seems to be related to Apple's standard library, since it's a compiler error that doesn't occur on Linux or Windows. We could add a macro specifically to check whether MacOS is being used and change the code based on that, I think that might be a better approach than creating new values.

@luca-schlecker
Copy link
Collaborator

I think including that if is sufficient as it doesn't really impact the rest.
If really wanted, that if could be wrapped inside a compiler macro disabling it for anything other than apple.
Something like this should work for detecting if on apple:

#if defined(__APPLE__) || defined(__MACH__)
...
#endif

Copy link
Collaborator

@luca-schlecker luca-schlecker left a comment

Choose a reason for hiding this comment

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

LGTM, though I didn't test it, as I don't have an osx device. 🎉

@The-EDev
Copy link
Member Author

Just tested on my MacOS machine, works like a charm. Merging now.

@The-EDev The-EDev merged commit cb78e79 into master Oct 23, 2021
@The-EDev The-EDev deleted the fix_macos branch October 23, 2021 00:06
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.

master branch doesn't compile on MacOS (blueprints/json::wvalue)
2 participants