pr2271-ssize-t-windows.patch 984 B

1234567891011121314151617181920212223242526272829303132
  1. From 3c6e8fb894b57e6195081de57aa4462e7a9eef8a Mon Sep 17 00:00:00 2001
  2. From: Yuriy Chernyshov <thegeorg@yandex-team.com>
  3. Date: Tue, 5 Nov 2024 12:42:23 +0100
  4. Subject: [PATCH] Workaround the lack of ssize_t type under Windows
  5. As [MSDN says](https://learn.microsoft.com/en-us/windows/win32/winprog/windows-data-types):
  6. ```
  7. A signed version of SIZE_T.
  8. This type is declared in BaseTsd.h as follows:
  9. typedef LONG_PTR SSIZE_T;
  10. ```
  11. ---
  12. lib/includes/nghttp2/nghttp2.h | 5 +++++
  13. 1 file changed, 5 insertions(+)
  14. diff --git a/lib/includes/nghttp2/nghttp2.h b/lib/includes/nghttp2/nghttp2.h
  15. index 2ef49b8d68..ed1978aa04 100644
  16. --- a/lib/includes/nghttp2/nghttp2.h
  17. +++ b/lib/includes/nghttp2/nghttp2.h
  18. @@ -55,6 +55,11 @@ extern "C" {
  19. #include <nghttp2/nghttp2ver.h>
  20. +#if defined(_MSC_VER)
  21. +# include <basetsd.h>
  22. + typedef SSIZE_T ssize_t;
  23. +#endif
  24. +
  25. #ifdef NGHTTP2_STATICLIB
  26. # define NGHTTP2_EXTERN
  27. #elif defined(WIN32) || \