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

Build and runtime fixes for Visual Studio 2015 #3448

Closed
wants to merge 2 commits into from

Conversation

fanc999
Copy link
Contributor

@fanc999 fanc999 commented Feb 17, 2022

Hi,

This attempts to improve the build and runtime situation when using Visual Studio 2015, by:

  • Adding specializations for std::hash for hb_bytes_t and struct hb_serialize_context_t::object_t, so that the build will not fail due to a C2338 error (The C++ Standard doesn't provide a hash for this type) on Visual Studio 2015. This will replace (and revert) commit 52c536b.

  • Fix meson test failure on MSVC #3379, where the templatized implementation of struct main_font_text_t confuses the template type text_options_t with the actual text_options_t, where we inherit from the actual text_options_t with shape_text_options_t.

Things now build properly with Visual Studio 2015 and tests now pass, with the full list of options that we can pass into hb-shape.exe.

With blessings, thank you!

…tions

This adds specializations for std::hash for the hb_bytes_t and the
hb_serialize_context_t::object_t, so that the code will build on Visual
Studio 2015 without the workaround in commit 52c536b where a hash
implementation is needed.

This will in effect revert commit 52c536b.
Rename text_option_t in the templatized implementation of
main_font_text_t so that we won't confuse between the text_option_t
template with the actual struct type that inherits from the actual
text_option_t structure, which will fix running on Visual Studio 2015.

This will fix harfbuzz#3379.
@behdad
Copy link
Member

behdad commented Feb 17, 2022

These are two separate issues. Should not be in the same PR.

  • Adding specializations for std::hash for hb_bytes_t and struct hb_serialize_context_t::object_t, so that the build will not fail due to a C2338 error (The C++ Standard doesn't provide a hash for this type) on Visual Studio 2015. This will replace (and revert) commit 52c536b.

This is wrong. Those types' hash are not expected to match std::hash, but our own hash call with priority<2>. If that's not being matched, there's something else going on. I'll go ahead and revert that commit until we figure out what's going on.

  • Fix meson test failure on MSVC #3379, where the templatized implementation of struct main_font_text_t confuses the template type text_options_t with the actual text_options_t, where we inherit from the actual text_options_t with shape_text_options_t.

Are you sure that's what's happening? I have a hard time believing that.

@behdad behdad closed this Feb 17, 2022
behdad added a commit that referenced this pull request Feb 17, 2022
@behdad
Copy link
Member

behdad commented Feb 17, 2022

For the hash issue first file an issue with the error, then discuss what you think is going on.

@behdad
Copy link
Member

behdad commented Feb 17, 2022

Quite likely we won't want to support that compiler.

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.

meson test failure on MSVC
3 participants