From e77a8fe4b722ec79bf31b1e855dbf938e900fa60 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Wed, 9 Nov 2022 22:29:07 +0100 Subject: [PATCH] CMakeLists.txt: fix compilation on musl For some reason musl does provide `strtof_l()`, but none of the others. It shouldn't even provide `strtof_l()`, as musl has zero locale support. This changes the check for a libc with locale support to check for `strtoull_l()` rather than for `strtof_l()`, which also works for musl. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 119855a..7ad7636 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,9 +45,9 @@ endif() # Auto-detect locale-narrow 'strtod_l' function. if(NOT DEFINED FLATBUFFERS_LOCALE_INDEPENDENT) if(MSVC) - check_cxx_symbol_exists(_strtof_l stdlib.h FLATBUFFERS_LOCALE_INDEPENDENT) + check_cxx_symbol_exists(_strtoull_l stdlib.h FLATBUFFERS_LOCALE_INDEPENDENT) else() - check_cxx_symbol_exists(strtof_l stdlib.h FLATBUFFERS_LOCALE_INDEPENDENT) + check_cxx_symbol_exists(strtoull_l stdlib.h FLATBUFFERS_LOCALE_INDEPENDENT) endif() endif() add_definitions(-DFLATBUFFERS_LOCALE_INDEPENDENT=$) -- 2.38.1