This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
locale.c: Silence compiler warnings for devel tool
authorKarl Williamson <khw@cpan.org>
Sat, 11 Nov 2023 20:22:30 +0000 (13:22 -0700)
committerKarl Williamson <khw@cpan.org>
Fri, 8 Dec 2023 02:23:22 +0000 (19:23 -0700)
These only occur when pretending that this is a MingW compilation, which
is a development-only tool to catch errors before they show up on a real
MingW box.  This would never get compiled for real.

locale.c

index af4c399..7efb6a7 100644 (file)
--- a/locale.c
+++ b/locale.c
@@ -392,17 +392,24 @@ static int debug_initialization = 0;
 #  define _configthreadlocale(arg) NOOP
 
 #  define MultiByteToWideChar(cp, flags, byte_string, m1, wstring, req_size) \
-                    (mbsrtowcs(wstring, &(byte_string), req_size, NULL) + 1)
+                    (PERL_UNUSED_ARG(cp),                                    \
+                     mbsrtowcs(wstring, &(byte_string), req_size, NULL) + 1)
 #  define WideCharToMultiByte(cp, flags, wstring, m1, byte_string,          \
                               req_size, default_char, found_default_char)   \
-                    (wcsrtombs(byte_string, &(wstring), req_size, NULL) + 1)
+                    (PERL_UNUSED_ARG(cp),                                   \
+                     wcsrtombs(byte_string, &(wstring), req_size, NULL) + 1)
 
 #  ifdef USE_LOCALE
 
 static const wchar_t * wsetlocale_buf = NULL;
 static Size_t wsetlocale_buf_size = 0;
+
+#    ifdef MULTIPLICITY
+
 static PerlInterpreter * wsetlocale_buf_aTHX = NULL;
 
+#    endif
+
 STATIC
 const wchar_t *
 S_wsetlocale(const int category, const wchar_t * wlocale)
@@ -4672,6 +4679,7 @@ Perl_get_win32_message_utf8ness(pTHX_ const char * string)
                                         NULL, LC_CTYPE_INDEX_);
 #    else
 
+    PERL_UNUSED_ARG(string);
     return false;
 
 #    endif