Global variables _pctype, _pwctype, _wctype and function __pctype_func() are 
constant.

See:
* 
https://learn.microsoft.com/en-us/cpp/c-runtime-library/pctype-pwctype-wctype-mbctype-mbcasemap
* https://learn.microsoft.com/en-us/cpp/c-runtime-library/pctype-func
---
 mingw-w64-headers/crt/ctype.h  | 14 +++++++-------
 mingw-w64-headers/crt/wchar.h  | 14 +++++++-------
 mingw-w64-headers/crt/wctype.h | 14 +++++++-------
 3 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/mingw-w64-headers/crt/ctype.h b/mingw-w64-headers/crt/ctype.h
index 5d5e7802e9ba..f23bcdc2ee84 100644
--- a/mingw-w64-headers/crt/ctype.h
+++ b/mingw-w64-headers/crt/ctype.h
@@ -26,7 +26,7 @@ extern "C" {
 #define __pctype_func()        (_pctype)
 #else
 #ifdef _UCRT
-  _CRTIMP unsigned short* __pctype_func(void);
+  _CRTIMP const unsigned short* __pctype_func(void);
 #else
 #define __pctype_func()        (* __MINGW_IMP_SYMBOL(_pctype))
 #endif
@@ -35,12 +35,12 @@ extern "C" {
 
 #ifndef _pctype
 #ifdef _MSVCRT_
-  extern unsigned short *_pctype;
+  extern const unsigned short *_pctype;
 #else
 #ifdef _UCRT
 #define _pctype (__pctype_func())
 #else
-  extern unsigned short ** __MINGW_IMP_SYMBOL(_pctype);
+  extern const unsigned short ** __MINGW_IMP_SYMBOL(_pctype);
 #define _pctype (* __MINGW_IMP_SYMBOL(_pctype))
 #endif
 #endif
@@ -54,21 +54,21 @@ extern "C" {
 #ifndef _CTYPE_DISABLE_MACROS
 #if !defined(_wctype) && defined(_CRT_USE_WINAPI_FAMILY_DESKTOP_APP)
 #ifdef _MSVCRT_
-  extern unsigned short *_wctype;
+  extern const unsigned short *_wctype;
 #else
-  extern unsigned short ** __MINGW_IMP_SYMBOL(_wctype);
+  extern const unsigned short ** __MINGW_IMP_SYMBOL(_wctype);
 #define _wctype (* __MINGW_IMP_SYMBOL(_wctype))
 #endif
 #endif
 #ifdef _MSVCRT_
 #define __pwctype_func() (_pwctype)
 #ifndef _pwctype
-  extern unsigned short *_pwctype;
+  extern const unsigned short *_pwctype;
 #endif
 #else
 #define __pwctype_func() (* __MINGW_IMP_SYMBOL(_pwctype))
 #ifndef _pwctype
-  extern unsigned short ** __MINGW_IMP_SYMBOL(_pwctype);
+  extern const unsigned short ** __MINGW_IMP_SYMBOL(_pwctype);
 #define _pwctype (* __MINGW_IMP_SYMBOL(_pwctype))
 #endif
 #endif
diff --git a/mingw-w64-headers/crt/wchar.h b/mingw-w64-headers/crt/wchar.h
index c20f5870a48b..6af60ca1c6bf 100644
--- a/mingw-w64-headers/crt/wchar.h
+++ b/mingw-w64-headers/crt/wchar.h
@@ -158,7 +158,7 @@ _CRTIMP FILE *__cdecl __acrt_iob_func(unsigned index);
 #define __pctype_func() (_pctype)
 #else
 #ifdef _UCRT
-  _CRTIMP unsigned short* __pctype_func(void);
+  _CRTIMP const unsigned short* __pctype_func(void);
 #else
 #define __pctype_func() (* __MINGW_IMP_SYMBOL(_pctype))
 #endif
@@ -167,12 +167,12 @@ _CRTIMP FILE *__cdecl __acrt_iob_func(unsigned index);
 
 #ifndef _pctype
 #ifdef _MSVCRT_
-  extern unsigned short *_pctype;
+  extern const unsigned short *_pctype;
 #else
 #ifdef _UCRT
 #define _pctype (__pctype_func())
 #else
-  extern unsigned short ** __MINGW_IMP_SYMBOL(_pctype);
+  extern const unsigned short ** __MINGW_IMP_SYMBOL(_pctype);
 #define _pctype (* __MINGW_IMP_SYMBOL(_pctype))
 #endif
 #endif
@@ -185,9 +185,9 @@ _CRTIMP FILE *__cdecl __acrt_iob_func(unsigned index);
 #ifndef _CTYPE_DISABLE_MACROS
 #if !defined(_wctype) && defined(_CRT_USE_WINAPI_FAMILY_DESKTOP_APP)
 #ifdef _MSVCRT_
-  extern unsigned short *_wctype;
+  extern const unsigned short *_wctype;
 #else
-  extern unsigned short ** __MINGW_IMP_SYMBOL(_wctype);
+  extern const unsigned short ** __MINGW_IMP_SYMBOL(_wctype);
 #define _wctype (* __MINGW_IMP_SYMBOL(_wctype))
 #endif
 #endif
@@ -200,9 +200,9 @@ _CRTIMP FILE *__cdecl __acrt_iob_func(unsigned index);
 
 #ifndef _pwctype
 #ifdef _MSVCRT_
-  extern unsigned short *_pwctype;
+  extern const unsigned short *_pwctype;
 #else
-  extern unsigned short ** __MINGW_IMP_SYMBOL(_pwctype);
+  extern const unsigned short ** __MINGW_IMP_SYMBOL(_pwctype);
 #define _pwctype (* __MINGW_IMP_SYMBOL(_pwctype))
 #endif
 #endif
diff --git a/mingw-w64-headers/crt/wctype.h b/mingw-w64-headers/crt/wctype.h
index 6ea012dc6cb3..7a05f9ed7aec 100644
--- a/mingw-w64-headers/crt/wctype.h
+++ b/mingw-w64-headers/crt/wctype.h
@@ -49,7 +49,7 @@ extern "C" {
 #define __pctype_func() (_pctype)
 #else
 #ifdef _UCRT
-  _CRTIMP unsigned short* __pctype_func(void);
+  _CRTIMP const unsigned short* __pctype_func(void);
 #else
 #define __pctype_func() (* __MINGW_IMP_SYMBOL(_pctype))
 #endif
@@ -58,12 +58,12 @@ extern "C" {
 
 #ifndef _pctype
 #ifdef _MSVCRT_
-  extern unsigned short *_pctype;
+  extern const unsigned short *_pctype;
 #else
 #ifdef _UCRT
 #define _pctype (__pctype_func())
 #else
-  extern unsigned short ** __MINGW_IMP_SYMBOL(_pctype);
+  extern const unsigned short ** __MINGW_IMP_SYMBOL(_pctype);
 #define _pctype (* __MINGW_IMP_SYMBOL(_pctype))
 #endif
 #endif
@@ -77,18 +77,18 @@ extern "C" {
 #ifndef _CTYPE_DISABLE_MACROS
 #if !defined(_wctype) && defined(_CRT_USE_WINAPI_FAMILY_DESKTOP_APP)
 #ifdef _MSVCRT_
-  extern unsigned short *_wctype;
+  extern const unsigned short *_wctype;
 #else
-  extern unsigned short ** __MINGW_IMP_SYMBOL(_wctype);
+  extern const unsigned short ** __MINGW_IMP_SYMBOL(_wctype);
 #define _wctype (* __MINGW_IMP_SYMBOL(_wctype))
 #endif
 #endif
 
 #ifndef _pwctype
 #ifdef _MSVCRT_
-  extern unsigned short *_pwctype;
+  extern const unsigned short *_pwctype;
 #else
-  extern unsigned short ** __MINGW_IMP_SYMBOL(_pwctype);
+  extern const unsigned short ** __MINGW_IMP_SYMBOL(_pwctype);
 #define _pwctype (* __MINGW_IMP_SYMBOL(_pwctype))
 #define __pwctype_func() (* __MINGW_IMP_SYMBOL(_pwctype))
 #endif
-- 
2.20.1



_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to