Fix position bug
[hiphop-php.git] / patches / shipit-mcrouter-D19279530.patch
blobe3b016bc1450e3506b7cdd104c3d2c2b11da7aab
1 From D19279530-96366234 Mon Sep 17 00:00:00 2001
2 From: Ján . <jjergus@fb.com>
3 Date: Tue, 07 Jan 2020 11:06:50 -0800
4 Subject: [PATCH] make ProxyDestinationKey.cpp more portable
6 Summary:
7 On some systems where we build HHVM packages, `std::hash` is not available for enums (specifically, GCC 5.5 doesn't support it despite claiming to support C++17) so we get compilation errors here.
9 These `static_cast`s (backported from how the hash is declared for enums in newer GCC's header files) would fix that.
11 If you're opposed, that's fine, I can abandon this and keep it as a HHVM-specific patch in our build system; but maintaining these patches is a non-trivial burden so anything like this that we can fix more generally helps us quite a bit.
13 Reviewed By: pavlo-fb
15 Differential Revision: D19279530
16 ---
18 diff --git a/third-party/mcrouter/src/mcrouter/ProxyDestinationKey.cpp b/third-party/mcrouter/src/mcrouter/ProxyDestinationKey.cpp
19 --- a/third-party/mcrouter/src/mcrouter/ProxyDestinationKey.cpp
20 +++ b/third-party/mcrouter/src/mcrouter/ProxyDestinationKey.cpp
21 @@ -36,8 +36,10 @@
22 auto result = folly::hash::hash_combine(
23 accessPoint.getHost(),
24 accessPoint.getPort(),
25 - accessPoint.getProtocol(),
26 - accessPoint.getSecurityMech(),
27 + static_cast<std::underlying_type_t<mc_protocol_e>>(
28 + accessPoint.getProtocol()),
29 + static_cast<std::underlying_type_t<SecurityMech>>(
30 + accessPoint.getSecurityMech()),
31 accessPoint.compressed());
32 if (accessPoint.getProtocol() == mc_ascii_protocol) {
33 result = folly::hash::hash_combine(result, timeout.count());
35 1.7.9.5