pr2275-msvc-support.patch 1.2 KB

1234567891011121314151617181920212223242526272829
  1. From 3f3b9289b066cfb9eaffa119816932e71266943f Mon Sep 17 00:00:00 2001
  2. From: Yuriy Chernyshov <thegeorg@yandex-team.com>
  3. Date: Mon, 9 May 2022 15:36:49 +0300
  4. Subject: [PATCH] Fix compiling edata.h with MSVC
  5. At the time an attempt to compile jemalloc 5.3.0 with MSVC 2019 results in the followin error message:
  6. > jemalloc/include/jemalloc/internal/edata.h:660: error C4576: a parenthesized type followed by an initializer list is a non-standard explicit type conversion syntax
  7. ---
  8. include/jemalloc/internal/edata.h | 6 ++++--
  9. 1 file changed, 4 insertions(+), 2 deletions(-)
  10. diff --git a/include/jemalloc/internal/edata.h b/include/jemalloc/internal/edata.h
  11. index af039ea73..e77a55e64 100644
  12. --- a/include/jemalloc/internal/edata.h
  13. +++ b/include/jemalloc/internal/edata.h
  14. @@ -656,8 +656,10 @@ edata_ead_comp(const edata_t *a, const edata_t *b) {
  15. static inline edata_cmp_summary_t
  16. edata_cmp_summary_get(const edata_t *edata) {
  17. - return (edata_cmp_summary_t){edata_sn_get(edata),
  18. - (uintptr_t)edata_addr_get(edata)};
  19. + edata_cmp_summary_t result;
  20. + result.sn = edata_sn_get(edata);
  21. + result.addr = (uintptr_t)edata_addr_get(edata);
  22. + return result;
  23. }
  24. static inline int