0001-fix-xlocale-header-check.patch 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. From a826b7b656c165bc35746d9af3ec371387d2bca1 Mon Sep 17 00:00:00 2001
  2. From: Adam Duskett <aduskett@gmail.com>
  3. Date: Mon, 23 Oct 2017 08:11:21 -0400
  4. Subject: [PATCH] fix xlocale header check
  5. asyncrt_utils.h checks if __GLIBC__ is not defined before including
  6. xlocal.h. This will cause a compilation failure on uclibc and musl.
  7. Add a proper check in CMakeLists.txt and check for HAVE_XLOCALE_H
  8. instead of __GLIBC__
  9. Upstream-Status: Accepted
  10. Signed-off-by: Adam Duskett <aduskett@gmail.com>
  11. ---
  12. Release/CMakeLists.txt | 3 +++
  13. Release/include/cpprest/asyncrt_utils.h | 2 +-
  14. 2 files changed, 4 insertions(+), 1 deletion(-)
  15. diff --git a/Release/CMakeLists.txt b/Release/CMakeLists.txt
  16. index d57aa3d..eefae75 100644
  17. --- a/Release/CMakeLists.txt
  18. +++ b/Release/CMakeLists.txt
  19. @@ -42,6 +42,7 @@ include(cmake/cpprest_find_boost.cmake)
  20. include(cmake/cpprest_find_zlib.cmake)
  21. include(cmake/cpprest_find_openssl.cmake)
  22. include(cmake/cpprest_find_websocketpp.cmake)
  23. +include(CheckIncludeFiles)
  24. find_package(Threads REQUIRED)
  25. if(THREADS_HAVE_PTHREAD_ARG)
  26. @@ -56,6 +57,8 @@ if(CPPREST_EXCLUDE_WEBSOCKETS)
  27. set(CPPREST_WEBSOCKETS_IMPL none CACHE STRING "Internal use.")
  28. endif()
  29. +CHECK_INCLUDE_FILES(xlocale.h HAVE_XLOCALE_H)
  30. +
  31. if(APPLE) # Note: also iOS
  32. set(CPPREST_PPLX_IMPL apple CACHE STRING "Internal use.")
  33. set(CPPREST_WEBSOCKETS_IMPL wspp CACHE STRING "Internal use.")
  34. diff --git a/Release/include/cpprest/asyncrt_utils.h b/Release/include/cpprest/asyncrt_utils.h
  35. index fac70a9..8faa2dc 100644
  36. --- a/Release/include/cpprest/asyncrt_utils.h
  37. +++ b/Release/include/cpprest/asyncrt_utils.h
  38. @@ -29,7 +29,7 @@
  39. #ifndef _WIN32
  40. #include <boost/algorithm/string.hpp>
  41. -#if !defined(ANDROID) && !defined(__ANDROID__) && !defined(__GLIBC__) // CodePlex 269
  42. +#if !defined(ANDROID) && !defined(__ANDROID__) && defined(HAVE_XLOCALE_H) // CodePlex 269
  43. /* Systems using glibc: xlocale.h has been removed from glibc 2.26
  44. The above include of locale.h is sufficient
  45. Further details: https://sourceware.org/git/?p=glibc.git;a=commit;h=f0be25b6336db7492e47d2e8e72eb8af53b5506d */
  46. --
  47. 2.13.6