Sync with trunk (48237)
[reactos.git] / lib / 3rdparty / mingw / crtexe.c
index cc8f197..a677301 100644 (file)
@@ -46,8 +46,6 @@ __declspec(dllimport) void __setusermatherr(int (__cdecl *)(struct _exception *)
 extern int * __MINGW_IMP_SYMBOL(_fmode);
 extern int * __MINGW_IMP_SYMBOL(_commode);
 
-#undef _fmode
-extern int _fmode;
 extern int * __MINGW_IMP_SYMBOL(_commode);
 #define _commode (* __MINGW_IMP_SYMBOL(_commode))
 extern int _dowildcard;
@@ -251,7 +249,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
@@ -463,12 +461,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);