crt: Add double underscore prefix to the mingw_app_type symbol

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ö <martin@martin.st>
diff --git a/mingw-w64-crt/crt/crtdll.c b/mingw-w64-crt/crt/crtdll.c
index 51b8d35..08cd592 100644
--- a/mingw-w64-crt/crt/crtdll.c
+++ b/mingw-w64-crt/crt/crtdll.c
@@ -48,7 +48,7 @@
 
 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 @@
 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 8b1c863..c6d4316 100644
--- a/mingw-w64-crt/crt/crtexe.c
+++ b/mingw-w64-crt/crt/crtexe.c
@@ -66,7 +66,7 @@
 /* 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 @@
 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 @@
 #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 @@
 #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 @@
   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 @@
 	__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 f5ce286..84413cd 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;