0010-Fix-for-platform-socklen_t-on-other-C-libraries-than.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. From 0bf90de93b9fe21df32319e27b2507154fa8a21d Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?J=C3=B6rg=20Krause?= <joerg.krause@embedded.rocks>
  3. Date: Fri, 15 Apr 2016 00:37:26 +0200
  4. Subject: [PATCH] Fix for platform socklen_t on other C libraries than glibc
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. This helps to make sure that QT_SOCKLEN_T is defined to be 'int'
  9. only when its glibc < 2 and not also for the libraries which may define
  10. it as per standards but are not glibc, e.g. musl.
  11. This patch is adapted from Qt5 [1].
  12. [1]
  13. https://github.com/qtproject/qtbase/commit/813f468a14fb84af43c1f8fc0a1430277358eba2
  14. Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
  15. ---
  16. mkspecs/linux-g++/qplatformdefs.h | 6 +++---
  17. 1 file changed, 3 insertions(+), 3 deletions(-)
  18. diff --git a/mkspecs/linux-g++/qplatformdefs.h b/mkspecs/linux-g++/qplatformdefs.h
  19. index de751dd..d4146ed 100644
  20. --- a/mkspecs/linux-g++/qplatformdefs.h
  21. +++ b/mkspecs/linux-g++/qplatformdefs.h
  22. @@ -86,10 +86,10 @@
  23. #undef QT_SOCKLEN_T
  24. -#if defined(__GLIBC__) && (__GLIBC__ >= 2)
  25. -#define QT_SOCKLEN_T socklen_t
  26. -#else
  27. +#if defined(__GLIBC__) && (__GLIBC__ < 2)
  28. #define QT_SOCKLEN_T int
  29. +#else
  30. +#define QT_SOCKLEN_T socklen_t
  31. #endif
  32. #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
  33. --
  34. 2.8.0