[MINGW-W64]
[reactos.git] / reactos / lib / 3rdparty / mingw / crtexe.c
index 409b76b..ce76fc1 100644 (file)
@@ -1,7 +1,7 @@
 /**
  * This file has no copyright assigned and is placed in the Public Domain.
  * This file is part of the w64 mingw-runtime package.
- * No warranty is given; refer to the file DISCLAIMER within this package.
+ * No warranty is given; refer to the file DISCLAIMER.PD within this package.
  */
 
 #undef CRTDLL
@@ -33,7 +33,7 @@ extern char *** __MINGW_IMP_SYMBOL(__initenv);
 #endif
 
 /* Hack, for bug in ld.  Will be removed soon.  */
-#define __ImageBase _image_base__
+#define __ImageBase __MINGW_LSYMBOL(_image_base__)
 /* This symbol is defined by ld.  */
 extern IMAGE_DOS_HEADER __ImageBase;
 
@@ -67,6 +67,7 @@ extern _CRTALLOC(".CRT$XIZ") _PIFV __xi_z[];
 extern _CRTALLOC(".CRT$XCA") _PVFV __xc_a[];
 extern _CRTALLOC(".CRT$XCZ") _PVFV __xc_z[];
 
+/* TLS initialization hook.  */
 extern const PIMAGE_TLS_CALLBACK __dyn_tls_init_callback;
 
 extern _PVFV *__onexitbegin;
@@ -184,7 +185,7 @@ __tmainCRTStartup (void)
 {
   _TCHAR *lpszCommandLine = NULL;
   STARTUPINFO StartupInfo;
-  BOOL inDoubleQuote = FALSE;
+  WINBOOL inDoubleQuote = FALSE;
   memset (&StartupInfo, 0, sizeof (STARTUPINFO));
   
   if (mingw_app_type)
@@ -250,7 +251,7 @@ __tmainCRTStartup (void)
 #ifdef _MBCS
        if (_ismbblead (*lpszCommandLine))
          {
-           if (*lpszCommandLine)
+           if (lpszCommandLine) /* FIXME: Why this check? Should I check for *lpszCommandLine != 0 too? */
              lpszCommandLine++;
          }
 #endif
@@ -462,12 +463,17 @@ static void duplicate_ppstrings (int ac, char ***av)
 }
 #endif
 
+#ifdef __MINGW_SHOW_INVALID_PARAMETER_EXCEPTION
+#define __UNUSED_PARAM_1(x) x
+#else
+#define __UNUSED_PARAM_1       __UNUSED_PARAM
+#endif
 static void
-__mingw_invalidParameterHandler (const wchar_t *expression __attribute__ ((__unused__)),
-                                const wchar_t *function __attribute__ ((__unused__)),
-                                const wchar_t *file __attribute__ ((__unused__)),
-                                unsigned int line __attribute__ ((__unused__)),
-                                uintptr_t pReserved __attribute__ ((__unused__)))
+__mingw_invalidParameterHandler (const wchar_t * __UNUSED_PARAM_1(expression),
+                                const wchar_t * __UNUSED_PARAM_1(function),
+                                const wchar_t * __UNUSED_PARAM_1(file),
+                                unsigned int    __UNUSED_PARAM_1(line),
+                                uintptr_t __UNUSED_PARAM(pReserved))
 {
 #ifdef __MINGW_SHOW_INVALID_PARAMETER_EXCEPTION
    wprintf(L"Invalid parameter detected in function %s. File: %s Line: %d\n", function, file, line);