0002-cplusplus-Fix-build-on-GCC-7.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. From 7b51bc95d9cf0d9a2e91a37319fa34e4e5f26927 Mon Sep 17 00:00:00 2001
  2. From: Kleis Auke Wolthuizen <github@kleisauke.nl>
  3. Date: Wed, 6 Jul 2022 12:58:15 +0200
  4. Subject: [PATCH] [cplusplus] Fix build on GCC < 7
  5. [Retrieved from:
  6. https://github.com/harfbuzz/harfbuzz/commit/7b51bc95d9cf0d9a2e91a37319fa34e4e5f26927]
  7. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  8. ---
  9. src/hb-cplusplus.hh | 12 ++++++++++--
  10. 1 file changed, 10 insertions(+), 2 deletions(-)
  11. diff --git a/src/hb-cplusplus.hh b/src/hb-cplusplus.hh
  12. index 86d0452080..f06a32d912 100644
  13. --- a/src/hb-cplusplus.hh
  14. +++ b/src/hb-cplusplus.hh
  15. @@ -166,8 +166,14 @@ HB_DEFINE_VTABLE (unicode_funcs);
  16. } // namespace hb
  17. +/* Workaround for GCC < 7, see:
  18. + * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480
  19. + * https://stackoverflow.com/a/25594741 */
  20. +namespace std {
  21. +
  22. +
  23. template<typename T>
  24. -struct std::hash<hb::shared_ptr<T>>
  25. +struct hash<hb::shared_ptr<T>>
  26. {
  27. std::size_t operator()(const hb::shared_ptr<T>& v) const noexcept
  28. {
  29. @@ -177,7 +183,7 @@ struct std::hash<hb::shared_ptr<T>>
  30. };
  31. template<typename T>
  32. -struct std::hash<hb::unique_ptr<T>>
  33. +struct hash<hb::unique_ptr<T>>
  34. {
  35. std::size_t operator()(const hb::unique_ptr<T>& v) const noexcept
  36. {
  37. @@ -187,6 +193,8 @@ struct std::hash<hb::unique_ptr<T>>
  38. };
  39. +} // namespace std
  40. +
  41. #endif /* __cplusplus */
  42. #endif /* HB_CPLUSPLUS_HH */