This symbol vaguely seems like it might be meant to be overridden
by the app code, but I don't see how that practically would work,
as the init routines (crtdll.c and crtexe.c) set it anyway, so
whatever default value the user code provided wouldn't have any
effect anyway.

Signed-off-by: Martin Storsjö <mar...@martin.st>
---
 mingw-w64-crt/crt/crtdll.c        |  4 ++--
 mingw-w64-crt/crt/crtexe.c        | 12 ++++++------
 mingw-w64-crt/crt/mingw_helpers.c |  2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/mingw-w64-crt/crt/crtdll.c b/mingw-w64-crt/crt/crtdll.c
index 51b8d3514..08cd5922a 100644
--- a/mingw-w64-crt/crt/crtdll.c
+++ b/mingw-w64-crt/crt/crtdll.c
@@ -48,7 +48,7 @@ static int __proc_attached = 0;
 
 static _onexit_table_t atexit_table;
 
-extern int mingw_app_type;
+extern int __mingw_app_type;
 
 extern WINBOOL WINAPI DllMain (HANDLE hDllHandle, DWORD dwReason, LPVOID 
lpreserved);
 
@@ -145,7 +145,7 @@ int __mingw_init_ehandler (void);
 WINBOOL WINAPI
 DllMainCRTStartup (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved)
 {
-  mingw_app_type = 0;
+  __mingw_app_type = 0;
   if (dwReason == DLL_PROCESS_ATTACH)
     {
 #if defined(__x86_64__) && !defined(__SEH__)
diff --git a/mingw-w64-crt/crt/crtexe.c b/mingw-w64-crt/crt/crtexe.c
index 8b1c86392..c6d43168b 100644
--- a/mingw-w64-crt/crt/crtexe.c
+++ b/mingw-w64-crt/crt/crtexe.c
@@ -66,7 +66,7 @@ extern _CRTALLOC(".CRT$XCZ") _PVFV __xc_z[];
 /* TLS initialization hook.  */
 extern const PIMAGE_TLS_CALLBACK __dyn_tls_init_callback;
 
-extern int mingw_app_type;
+extern int __mingw_app_type;
 
 HINSTANCE __mingw_winmain_hInstance;
 _TCHAR *__mingw_winmain_lpCmdLine;
@@ -126,7 +126,7 @@ static int __cdecl
 pre_c_init (void)
 {
   managedapp = check_managed_app ();
-  if (mingw_app_type)
+  if (__mingw_app_type)
     __set_app_type(_GUI_APP);
   else
     __set_app_type (_CONSOLE_APP);
@@ -172,7 +172,7 @@ int WinMainCRTStartup (void)
 #ifdef SEH_INLINE_ASM
   asm ("\t.l_startw:\n");
 #endif
-  mingw_app_type = 1;
+  __mingw_app_type = 1;
   ret = __tmainCRTStartup ();
 #ifdef SEH_INLINE_ASM
   asm ("\tnop\n"
@@ -198,7 +198,7 @@ int mainCRTStartup (void)
 #ifdef SEH_INLINE_ASM
   asm ("\t.l_start:\n");
 #endif
-  mingw_app_type = 0;
+  __mingw_app_type = 0;
   ret = __tmainCRTStartup ();
 #ifdef SEH_INLINE_ASM
   asm ("\tnop\n"
@@ -226,7 +226,7 @@ __tmainCRTStartup (void)
   WINBOOL inDoubleQuote = FALSE;
   memset (&StartupInfo, 0, sizeof (STARTUPINFO));
 
-  if (mingw_app_type)
+  if (__mingw_app_type)
     GetStartupInfo (&StartupInfo);
   {
     void *lock_free = NULL;
@@ -304,7 +304,7 @@ __tmainCRTStartup (void)
        __mingw_winmain_lpCmdLine = lpszCommandLine;
       }
 
-    if (mingw_app_type)
+    if (__mingw_app_type)
       {
        __mingw_winmain_nShowCmd = StartupInfo.dwFlags & STARTF_USESHOWWINDOW ?
                                    StartupInfo.wShowWindow : SW_SHOWDEFAULT;
diff --git a/mingw-w64-crt/crt/mingw_helpers.c 
b/mingw-w64-crt/crt/mingw_helpers.c
index f5ce286ef..84413cdb7 100644
--- a/mingw-w64-crt/crt/mingw_helpers.c
+++ b/mingw-w64-crt/crt/mingw_helpers.c
@@ -5,4 +5,4 @@
  */
 
 /* 0:console, 1:windows.  */
-int mingw_app_type = 0;
+int __mingw_app_type = 0;
-- 
2.25.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