Skip to content

Commit

Permalink
8270479: WebKit 612.1 build fails with Visual Studio 2017
Browse files Browse the repository at this point in the history
Backport-of: 8aaacb5bd5368d544c4c468f85ce9ed4dbf26d07
  • Loading branch information
kevinrushforth committed Aug 18, 2021
1 parent 929b9c2 commit 7bc9584
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
Expand Up @@ -2695,6 +2695,15 @@ static bool isSiblingSubsequent(const Node& siblingA, const Node& siblingB)
return false;
}

#if PLATFORM(JAVA)
// VS 2017 has buggy support for compile-time inline constants, so they
// are defined here as runtime constants
const PartialOrdering PartialOrdering::less(Type::Less);
const PartialOrdering PartialOrdering::equivalent(Type::Equivalent);
const PartialOrdering PartialOrdering::greater(Type::Greater);
const PartialOrdering PartialOrdering::unordered(Type::Unordered);
#endif

template<TreeType treeType> PartialOrdering treeOrder(const Node& a, const Node& b)
{
if (&a == &b)
Expand Down
5 changes: 5 additions & 0 deletions modules/javafx.web/src/main/native/Source/WebCore/dom/Node.h
Expand Up @@ -941,10 +941,15 @@ inline void Node::addInclusiveAncestorState(AncestorState state)
}
}

#if PLATFORM(JAVA)
// VS 2017 has buggy support for compile-time inline constants, so the
// definitions are moved to Node.cpp
#else
inline constexpr PartialOrdering PartialOrdering::less(Type::Less);
inline constexpr PartialOrdering PartialOrdering::equivalent(Type::Equivalent);
inline constexpr PartialOrdering PartialOrdering::greater(Type::Greater);
inline constexpr PartialOrdering PartialOrdering::unordered(Type::Unordered);
#endif

constexpr bool is_eq(PartialOrdering ordering)
{
Expand Down
Expand Up @@ -1195,8 +1195,15 @@ void InspectorOverlay::drawLayoutLabel(GraphicsContext& context, String label, F
FontCascade font(WTFMove(fontDescription), 0, 0);
font.update(nullptr);

#if PLATFORM(JAVA)
// VS2017 complains if these are not defined as float constants (which they
// really should be anyway)
constexpr auto padding = 4.0f;
constexpr auto arrowSize = 4.0f;
#else
constexpr auto padding = 4;
constexpr auto arrowSize = 4;
#endif
float textHeight = font.fontMetrics().floatHeight();
float textDescent = font.fontMetrics().floatDescent();

Expand Down

1 comment on commit 7bc9584

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

Please sign in to comment.