From 07c2d68447335dab42c81afa80a4a637a4bb7947 Mon Sep 17 00:00:00 2001
From: Juan Jose Santamaria Flecha <juanjo.santamaria@gmail.com>
Date: Tue, 8 Nov 2022 16:17:08 -0500
Subject: [PATCH] meson define HAVE_LOCALE_T for mscv

Meson doesn't see the redefinition of locale_t done in
src/include/port/win32_port.h, so is not defining HAVE_LOCALE_T,
HAVE_WCSTOMBS_L nor HAVE_MBSTOWCS_L as the current
src/tools/msvc/build.pl script does.
---
 meson.build | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/meson.build b/meson.build
index bfacbdc..d109d02 100644
--- a/meson.build
+++ b/meson.build
@@ -2199,6 +2199,8 @@ if cc.has_type('locale_t', prefix: '#include <locale.h>')
 elif cc.has_type('locale_t', prefix: '#include <xlocale.h>')
   cdata.set('HAVE_LOCALE_T', 1)
   cdata.set('LOCALE_T_IN_XLOCALE', 1)
+elif cc.get_id() == 'msvc'
+  cdata.set('HAVE_LOCALE_T', 1)
 endif
 
 # Check if the C compiler understands typeof or a variant.  Define
@@ -2411,6 +2413,12 @@ if cc.has_function('syslog', args: test_c_args) and \
 endif
 
 
+if cc.get_id() == 'msvc'
+  cdata.set('HAVE_WCSTOMBS_L', 1)
+  cdata.set('HAVE_MBSTOWCS_L', 1)
+endif
+
+
 # if prerequisites for unnamed posix semas aren't fulfilled, fall back to sysv
 # semaphores
 if sema_kind == 'unnamed_posix' and \
-- 
2.11.0

