0001-Add-detection-of-strtoull_l-function.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. From bff7ffbc5130cd46caf33b76b4bb0593fcd15066 Mon Sep 17 00:00:00 2001
  2. From: Vladimir Glavnyy <31897320+vglavnyy@users.noreply.github.com>
  3. Date: Fri, 10 May 2019 00:15:29 +0700
  4. Subject: [PATCH] Add detection of strtoull_l function (#5333) (#5337)
  5. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  6. [Retrieved from:
  7. https://github.com/google/flatbuffers/commit/bff7ffbc5130cd46caf33b76b4bb0593fcd15066]
  8. ---
  9. CMakeLists.txt | 12 +++++++++---
  10. 1 file changed, 9 insertions(+), 3 deletions(-)
  11. diff --git a/CMakeLists.txt b/CMakeLists.txt
  12. index 0640c37b5..30be238fe 100644
  13. --- a/CMakeLists.txt
  14. +++ b/CMakeLists.txt
  15. @@ -42,12 +42,18 @@ if(DEFINED FLATBUFFERS_MAX_PARSING_DEPTH)
  16. message(STATUS "FLATBUFFERS_MAX_PARSING_DEPTH: ${FLATBUFFERS_MAX_PARSING_DEPTH}")
  17. endif()
  18. -# Auto-detect locale-narrow 'strtod_l' function.
  19. +# Auto-detect locale-narrow 'strtod_l' and 'strtoull_l' functions.
  20. if(NOT DEFINED FLATBUFFERS_LOCALE_INDEPENDENT)
  21. + set(FLATBUFFERS_LOCALE_INDEPENDENT 0)
  22. if(MSVC)
  23. - check_cxx_symbol_exists(_strtof_l stdlib.h FLATBUFFERS_LOCALE_INDEPENDENT)
  24. + check_cxx_symbol_exists(_strtof_l stdlib.h FLATBUFFERS_HAS_STRTOF_L)
  25. + check_cxx_symbol_exists(_strtoui64_l stdlib.h FLATBUFFERS_HAS_STRTOULL_L)
  26. else()
  27. - check_cxx_symbol_exists(strtof_l stdlib.h FLATBUFFERS_LOCALE_INDEPENDENT)
  28. + check_cxx_symbol_exists(strtof_l stdlib.h FLATBUFFERS_HAS_STRTOF_L)
  29. + check_cxx_symbol_exists(strtoull_l stdlib.h FLATBUFFERS_HAS_STRTOULL_L)
  30. + endif()
  31. + if(FLATBUFFERS_HAS_STRTOF_L AND FLATBUFFERS_HAS_STRTOULL_L)
  32. + set(FLATBUFFERS_LOCALE_INDEPENDENT 1)
  33. endif()
  34. endif()
  35. add_definitions(-DFLATBUFFERS_LOCALE_INDEPENDENT=$<BOOL:${FLATBUFFERS_LOCALE_INDEPENDENT}>)