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