mingw32.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. From 914de9d8fdcd7963b44ec496f32deacd859083e3 Mon Sep 17 00:00:00 2001
  2. From: Christopher Schwartz <[email protected]>
  3. Date: Wed, 26 Mar 2025 14:00:04 +0100
  4. Subject: [PATCH] Fix issue #2009 of failing build on 32-bit MinGW
  5. Signed-off-by: Christopher Schwartz <[email protected]>
  6. ---
  7. src/lib/OpenEXRCore/chunk.c | 12 ++++++++++++
  8. 1 file changed, 12 insertions(+)
  9. diff --git a/src/lib/OpenEXRCore/chunk.c b/src/lib/OpenEXRCore/chunk.c
  10. index ec3ed7777..ababa9d00 100644
  11. --- a/src/lib/OpenEXRCore/chunk.c
  12. +++ b/src/lib/OpenEXRCore/chunk.c
  13. @@ -565,7 +565,13 @@ extract_chunk_table (
  14. if (ctable == NULL)
  15. {
  16. int64_t nread = 0;
  17. +#ifdef EXR_HAS_STD_ATOMICS
  18. + uintptr_t eptr = 0, nptr = 0;
  19. +#elif defined(_MSC_VER)
  20. uint64_t eptr = 0, nptr = 0;
  21. +#else
  22. +# error OS unimplemented support for atomics
  23. +#endif
  24. int complete = 1;
  25. uint64_t maxoff = ((uint64_t) -1);
  26. exr_result_t rv;
  27. @@ -639,7 +645,13 @@ extract_chunk_table (
  28. }
  29. else { priv_to_native64 (ctable, part->chunk_count); }
  30. +#ifdef EXR_HAS_STD_ATOMICS
  31. + nptr = (uintptr_t) ctable;
  32. +#elif defined(_MSC_VER)
  33. nptr = (uint64_t) ctable;
  34. +#else
  35. +# error OS unimplemented support for atomics
  36. +#endif
  37. // see if we win or not
  38. if (!atomic_compare_exchange_strong (
  39. EXR_CONST_CAST (atomic_uintptr_t*, &(part->chunk_table)),