File tree 3 files changed +14
-6
lines changed
3 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -127,11 +127,18 @@ if (MASTER_PROJECT AND CMAKE_GENERATOR MATCHES "Visual Studio")
127
127
${CMAKE_MAKE_PROGRAM} -p:FrameworkPathOverride=\" ${netfxpath} \" %*" )
128
128
endif ()
129
129
130
+ set (strtod_l_headers stdlib.h)
131
+ if (APPLE )
132
+ set (strtod_l_headers ${strtod_l_headers} xlocale.h)
133
+ endif ()
134
+
130
135
include (CheckSymbolExists)
131
136
if (WIN32 )
132
137
check_symbol_exists(open io.h HAVE_OPEN)
138
+ check_symbol_exists(_strtod_l "${strtod_l_headers} " HAVE_STRTOD_L)
133
139
else ()
134
140
check_symbol_exists(open fcntl.h HAVE_OPEN)
141
+ check_symbol_exists(strtod_l "${strtod_l_headers} " HAVE_STRTOD_L)
135
142
endif ()
136
143
137
144
function (add_headers VAR)
@@ -154,6 +161,10 @@ endif ()
154
161
add_library (fmt ${FMT_SOURCES} ${FMT_HEADERS} README.rst ChangeLog.rst)
155
162
add_library (fmt::fmt ALIAS fmt)
156
163
164
+ if (HAVE_STRTOD_L)
165
+ target_compile_definitions (fmt PUBLIC FMT_LOCALE)
166
+ endif ()
167
+
157
168
if (FMT_WERROR)
158
169
target_compile_options (fmt PRIVATE ${WERROR_FLAG} )
159
170
endif ()
Original file line number Diff line number Diff line change @@ -261,12 +261,6 @@ class file {
261
261
// Returns the memory page size.
262
262
long getpagesize ();
263
263
264
- #if (defined(LC_NUMERIC_MASK) || defined(_MSC_VER)) && \
265
- !defined(__ANDROID__) && !defined(__CYGWIN__) && !defined(__OpenBSD__) && \
266
- !defined(__NEWLIB_H__)
267
- # define FMT_LOCALE
268
- #endif
269
-
270
264
#ifdef FMT_LOCALE
271
265
// A "C" numeric locale.
272
266
class Locale {
Original file line number Diff line number Diff line change @@ -118,6 +118,9 @@ if (HAVE_OPEN)
118
118
if (FMT_PEDANTIC)
119
119
target_compile_options (posix-mock-test PRIVATE ${PEDANTIC_COMPILE_FLAGS} )
120
120
endif ()
121
+ if (HAVE_STRTOD_L)
122
+ target_compile_definitions (posix-mock-test PRIVATE FMT_LOCALE)
123
+ endif ()
121
124
add_test (NAME posix-mock-test COMMAND posix-mock-test )
122
125
add_fmt_test(posix-test )
123
126
endif ()
You can’t perform that action at this time.
0 commit comments