@@ -2193,12 +2193,15 @@ endif
2193
2193
2194
2194
# Check for the locale_t type and find the right header file. macOS
2195
2195
# needs xlocale.h; standard is locale.h, but glibc also has an
2196
- # xlocale.h file that we should not use.
2196
+ # xlocale.h file that we should not use. MSVC has a replacement
2197
+ # defined in src/include/port/win32_port.h.
2197
2198
if cc.has_type(' locale_t' , prefix : ' #include <locale.h>' )
2198
2199
cdata.set(' HAVE_LOCALE_T' , 1 )
2199
2200
elif cc.has_type(' locale_t' , prefix : ' #include <xlocale.h>' )
2200
2201
cdata.set(' HAVE_LOCALE_T' , 1 )
2201
2202
cdata.set(' LOCALE_T_IN_XLOCALE' , 1 )
2203
+ elif cc.get_id() == ' msvc'
2204
+ cdata.set(' HAVE_LOCALE_T' , 1 )
2202
2205
endif
2203
2206
2204
2207
# Check if the C compiler understands typeof or a variant. Define
@@ -2411,6 +2414,13 @@ if cc.has_function('syslog', args: test_c_args) and \
2411
2414
endif
2412
2415
2413
2416
2417
+ # MSVC has replacements defined in src/include/port/win32_port.h.
2418
+ if cc.get_id() == ' msvc'
2419
+ cdata.set(' HAVE_WCSTOMBS_L' , 1 )
2420
+ cdata.set(' HAVE_MBSTOWCS_L' , 1 )
2421
+ endif
2422
+
2423
+
2414
2424
# if prerequisites for unnamed posix semas aren't fulfilled, fall back to sysv
2415
2425
# semaphores
2416
2426
if sema_kind == ' unnamed_posix' and \
0 commit comments