msvc defines _commode and __p__commode() also in internal.h.
---
 mingw-w64-crt/crt/crtexe.c       | 2 --
 mingw-w64-crt/include/internal.h | 5 +++++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/mingw-w64-crt/crt/crtexe.c b/mingw-w64-crt/crt/crtexe.c
index 94bad6aaff27..422c6bdd7ef9 100644
--- a/mingw-w64-crt/crt/crtexe.c
+++ b/mingw-w64-crt/crt/crtexe.c
@@ -22,8 +22,6 @@
 
 extern IMAGE_DOS_HEADER __ImageBase;
 
-int *__cdecl __p__commode(void);
-
 #undef _fmode
 extern int _fmode;
 #undef _commode
diff --git a/mingw-w64-crt/include/internal.h b/mingw-w64-crt/include/internal.h
index 997a89b189a1..858650366f93 100644
--- a/mingw-w64-crt/include/internal.h
+++ b/mingw-w64-crt/include/internal.h
@@ -71,6 +71,11 @@ extern "C" {
 
 #define _NO_CONSOLE_FILENO (intptr_t)-2
 
+_CRTIMP int *__cdecl __p__commode(void);
+#ifndef _commode
+#define _commode (* __p__commode())
+#endif
+
 #ifndef _FILE_DEFINED
 #define _FILE_DEFINED
   struct _iobuf {
-- 
2.20.1



_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to