These macros depends on ANSI / UNICODE build type and therefore for example
_fgettc_nolock has different definition based on _UNICODE macro.

Currently there are duplicate and different definitions:

  #define _fgettc_nolock _fgetwc_nolock
  #define _fgettc_nolock _fgetc_nolock

Which are causing compile warnings:
  include/tchar.h:784: warning: "_fgettc_nolock" redefined
   #define _fgettc_nolock _fgetc_nolock

  include/tchar.h:772: note: this is the location of the previous definition
   #define _fgettc_nolock _fgetwc_nolock

This change fixes commit 2f9a13461d265592b33cc9ff0e425ecb0df9499c
("include/crt: Ensure declarations of `_*_nolock` match MSVCRT version").
---
 mingw-w64-headers/crt/tchar.h | 27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/mingw-w64-headers/crt/tchar.h b/mingw-w64-headers/crt/tchar.h
index 6022f551c058..aabf3778746e 100644
--- a/mingw-w64-headers/crt/tchar.h
+++ b/mingw-w64-headers/crt/tchar.h
@@ -404,6 +404,21 @@ extern "C" {
 
 #define _tsetlocale _wsetlocale
 
+#if __MSVCRT_VERSION__ >= 0x800
+#define _fgettc_nolock _fgetwc_nolock
+#define _fputtc_nolock _fputwc_nolock
+#define _gettc_nolock _getwc_nolock
+#define _gettch_nolock _getwch_nolock
+#define _gettche_nolock _getwche_nolock
+#define _gettchar_nolock _getwchar_nolock
+#define _puttc_nolock _putwc_nolock
+#define _puttchar_nolock _putwchar_nolock
+#define _puttch_nolock _putwch_nolock
+#define _ungettc_nolock _ungetwc_nolock
+#define _ungettch_nolock _ungetwch_nolock
+#define _tgetdcwd_nolock _wgetdcwd_nolock
+#endif
+
 #define _tcsclen wcslen
 #define _tcscnlen wcsnlen
 #define _tcsclen_l(_String,_Locale) wcslen(_String)
@@ -769,18 +784,6 @@ extern "C" {
 #define _tsetlocale setlocale
 
 #if __MSVCRT_VERSION__ >= 0x800
-#define _fgettc_nolock _fgetwc_nolock
-#define _fputtc_nolock _fputwc_nolock
-#define _gettc_nolock _getwc_nolock
-#define _gettch_nolock _getwch_nolock
-#define _gettche_nolock _getwche_nolock
-#define _gettchar_nolock _getwchar_nolock
-#define _puttc_nolock _putwc_nolock
-#define _puttchar_nolock _putwchar_nolock
-#define _puttch_nolock _putwch_nolock
-#define _ungettc_nolock _ungetwc_nolock
-#define _ungettch_nolock _ungetwch_nolock
-#define _tgetdcwd_nolock _wgetdcwd_nolock
 #define _fgettc_nolock _fgetc_nolock
 #define _fputtc_nolock _fputc_nolock
 #define _gettc_nolock _getc_nolock
-- 
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