[ros-diffs] [tkreuzer] 46537: [MINGW] Update mingw library to mingw-w64 trunk (mingw-w64-src_20100325)

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Mon Mar 29 01:27:03 CEST 2010


Author: tkreuzer
Date: Mon Mar 29 01:27:01 2010
New Revision: 46537

URL: http://svn.reactos.org/svn/reactos?rev=46537&view=rev
Log:
[MINGW]
Update mingw library to mingw-w64 trunk (mingw-w64-src_20100325)

Added:
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/CRT_noglob.c   (with props)
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crtbegin.c   (with props)
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crtend.c   (with props)
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/isascii.c   (with props)
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/iscsym.c   (with props)
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/iscsymf.c   (with props)
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/strcasecmp.c   (with props)
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/strncasecmp.c   (with props)
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/tlsmcrt.c   (with props)
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/tlsmthread.c   (with props)
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/tlsthrd.c   (with props)
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/toascii.c   (with props)
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/ucrtexe.c   (with props)
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/udll_argv.c   (with props)
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/udllargc.c   (with props)
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/wcscmpi.c   (with props)
Removed:
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/dummy_mingwthrd.c
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/getopt.c
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/mingwthrd_nomt.c
Modified:
    branches/ros-amd64-bringup/reactos/include/reactos/mingw-w64/internal.h
    branches/ros-amd64-bringup/reactos/include/reactos/mingw-w64/oscalls.h
    branches/ros-amd64-bringup/reactos/include/reactos/mingw-w64/sect_attribs.h
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/CRT_fp10.c
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/CRT_fp8.c
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/CRT_glob.c
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/_newmode.c
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/atonexit.c
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/binmode.c
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/charmax.c
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crt0_c.c
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crt0_w.c
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crt_handler.c
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crtdll.c
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crtexe.c
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/dll_argv.c
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/dllargv.c
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/dllentry.c
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/gccmain.c
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/gs_support.c
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/merr.c
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/mingw.rbuild
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/mingw_custom.c
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/mingw_helpers.c
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/natstart.c
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/pesect.c
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/pseudo-reloc-list.c
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/pseudo-reloc.c
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/tlssup.c
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/txtmode.c
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/wildcard.c
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/xncommod.c
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/xthdloc.c
    branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/xtxtmode.c

Modified: branches/ros-amd64-bringup/reactos/include/reactos/mingw-w64/internal.h
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/include/reactos/mingw-w64/internal.h?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/include/reactos/mingw-w64/internal.h [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/include/reactos/mingw-w64/internal.h [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -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.
  */
 
 #ifndef _INC_INTERNAL
@@ -18,9 +18,12 @@
 
 #pragma pack(push,_CRT_PACKING)
 
+#ifndef __INTERNAL_FUNC_DEFINED
+#define __INTERNAL_FUNC_DEFINED
   typedef void (__cdecl *_PVFV)(void);
   typedef int (__cdecl *_PIFV)(void);
   typedef void (__cdecl *_PVFI)(int);
+#endif
 
 #if defined (SPECIAL_CRTEXE) && (defined (_DLL) || defined (__GNUC__))
   extern int _commode;
@@ -32,12 +35,6 @@
 #define __IOINFO_TM_UTF8 1
 #define __IOINFO_TM_UTF16LE 2
 
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning(disable:4214)
-#pragma warning(disable:4820)
-#endif
-
   typedef struct {
     intptr_t osfhnd;
     char osfile;
@@ -48,10 +45,6 @@
     char unicode : 1;
     char pipech2[2];
   } ioinfo;
-
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
 
 #define IOINFO_ARRAY_ELTS (1 << 5)
 

Modified: branches/ros-amd64-bringup/reactos/include/reactos/mingw-w64/oscalls.h
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/include/reactos/mingw-w64/oscalls.h?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/include/reactos/mingw-w64/oscalls.h [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/include/reactos/mingw-w64/oscalls.h [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -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.
  */
 
 #ifndef _INC_OSCALLS
@@ -30,11 +30,6 @@
 #endif
 #endif
 
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning(disable:4214)
-#endif
-
 typedef struct _FTIME
 {
   unsigned short twosecs : 5;
@@ -51,10 +46,6 @@
   unsigned short year : 7;
 } FDATE;
 
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-
 typedef FDATE *PFDATE;
 
 #endif

Modified: branches/ros-amd64-bringup/reactos/include/reactos/mingw-w64/sect_attribs.h
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/include/reactos/mingw-w64/sect_attribs.h?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/include/reactos/mingw-w64/sect_attribs.h [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/include/reactos/mingw-w64/sect_attribs.h [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -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.
  */
 
 #if defined (__ia64__) || defined (__x86_64)
@@ -10,7 +10,7 @@
 #define _ATTRIBUTES shared
 #endif
 
-#if defined(_MSC_VER)
+#if 0
 /* Reference list of existing section for msvcrt.  */
 #pragma section(".CRTMP$XCA",long,_ATTRIBUTES)
 #pragma section(".CRTMP$XCZ",long,_ATTRIBUTES)
@@ -55,14 +55,6 @@
 #pragma section(".rtc$IZZ",long,read)
 #pragma section(".rtc$TAA",long,read)
 #pragma section(".rtc$TZZ",long,read)
-#pragma section(".tls",long,read,write)
-#pragma section(".tls$ZZZ",long,read,write)
 #endif
 
-#if defined(_MSC_VER)
-#define _CRTALLOC(x) __declspec(allocate(x))
-#elif defined(__GNUC__)
 #define _CRTALLOC(x) __attribute__ ((section (x) ))
-#else
-#error
-#endif

Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/CRT_fp10.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/CRT_fp10.c?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/CRT_fp10.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/CRT_fp10.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -1,22 +1,12 @@
 /**
  * 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.
  */
 
 void _fpreset (void);
 
 void _fpreset (void)
-{ 
-#ifdef __GNUC__
-    __asm__ ("fninit" );
-#else
-    __asm fninit;
-#endif
-}
+  { __asm__ ("fninit" ) ;}
 
-#ifdef __GNUC__
 void __attribute__ ((alias ("_fpreset"))) fpreset(void);
-#else
-void fpreset(void) { _fpreset(); }
-#endif

Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/CRT_fp8.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/CRT_fp8.c?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/CRT_fp8.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/CRT_fp8.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -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.
  */
 
 #include <_mingw.h>
@@ -14,8 +14,4 @@
   (* __MINGW_IMP_SYMBOL(_fpreset))();
 }
 
-#ifdef __GNUC__
 void __attribute__ ((alias ("_fpreset"))) fpreset(void);
-#else
-void fpreset(void) { _fpreset(); }
-#endif

Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/CRT_glob.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/CRT_glob.c?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/CRT_glob.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/CRT_glob.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -2,7 +2,7 @@
  * CRT_glob.c
  * This file has no copyright is 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 the package.
+ * No warranty is given; refer to the file DISCLAIMER.PD within the package.
  *
  * Include this object file to set _dowildcard to a state that will turn on
  * command line globbing by default. (wildcard.o which goes into libmingw32.a

Added: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/CRT_noglob.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/CRT_noglob.c?rev=46537&view=auto
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/CRT_noglob.c (added)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/CRT_noglob.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -1,0 +1,17 @@
+/*
+ * CRT_noglob.c
+ * This file has no copyright is 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.PD within the package.
+ *
+ * Include this object file to set _dowildcard to a state that will turn off
+ * command line globbing by default. (wildcard.o which goes into libmingw32.a
+ * has a default state of off if not configured with --enable-wildcard.)
+ *
+ * To use this object include the object file in your link command:
+ * gcc -o foo.exe foo.o CRT_noglob.o
+ *
+ */
+
+int _dowildcard = 0;
+

Propchange: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/CRT_noglob.c
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/_newmode.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/_newmode.c?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/_newmode.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/_newmode.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -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.
  */
 
 int _newmode = 0;

Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/atonexit.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/atonexit.c?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/atonexit.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/atonexit.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -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

Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/binmode.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/binmode.c?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/binmode.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/binmode.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -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.
  */
 
 #define SPECIAL_CRTEXE

Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/charmax.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/charmax.c?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/charmax.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/charmax.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -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.
  */
 
 #include <sect_attribs.h>

Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crt0_c.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crt0_c.c?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crt0_c.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crt0_c.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -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.
  */
 
 #include <windows.h>

Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crt0_w.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crt0_w.c?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crt0_w.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crt0_w.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -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.
  */
 #include <windows.h>
 

Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crt_handler.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crt_handler.c?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crt_handler.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crt_handler.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -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.
  */
 
 #include <windows.h>
@@ -12,6 +12,14 @@
 #include <memory.h>
 #include <signal.h>
 #include <stdio.h>
+
+#if defined (_WIN64) && defined (__ia64__)
+#error FIXME: Unsupported __ImageBase implementation.
+#else
+#define __ImageBase __MINGW_LSYMBOL(_image_base__)
+/* This symbol is defined by the linker.  */
+extern IMAGE_DOS_HEADER __ImageBase;
+#endif
 
 #pragma pack(push,1)
 typedef struct _UNWIND_INFO {
@@ -107,6 +115,8 @@
 	  (*old_handler) (SIGSEGV);
 	  action = EXCEPTION_CONTINUE_EXECUTION;
 	}
+      else
+        action = EXCEPTION_EXECUTE_HANDLER;
       break;
     case EXCEPTION_ILLEGAL_INSTRUCTION:
     case EXCEPTION_PRIV_INSTRUCTION:
@@ -125,6 +135,8 @@
 	  (*old_handler) (SIGILL);
 	  action = EXCEPTION_CONTINUE_EXECUTION;
 	}
+      else
+        action = EXCEPTION_EXECUTE_HANDLER;
       break;
     case EXCEPTION_FLT_INVALID_OPERATION:
     case EXCEPTION_FLT_DIVIDE_BY_ZERO:

Added: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crtbegin.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crtbegin.c?rev=46537&view=auto
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crtbegin.c (added)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crtbegin.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -1,0 +1,6 @@
+/**
+ * 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.PD within this package.
+ */
+

Propchange: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crtbegin.c
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crtdll.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crtdll.c?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crtdll.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crtdll.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -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.
  */
 
 #ifdef CRTDLL
@@ -40,6 +40,7 @@
 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;
 
 static int __proc_attached = 0;
@@ -49,9 +50,9 @@
 
 extern int mingw_app_type;
 
-extern BOOL WINAPI DllMain (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved);
-
-extern BOOL WINAPI DllEntryPoint (HANDLE, DWORD, LPVOID);
+extern WINBOOL WINAPI DllMain (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved);
+
+extern WINBOOL WINAPI DllEntryPoint (HANDLE, DWORD, LPVOID);
 
 static int pre_c_init (void);
 
@@ -71,7 +72,7 @@
   return 0;
 }
 
-BOOL WINAPI _CRT_INIT (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved)
+WINBOOL WINAPI _CRT_INIT (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved)
 {
   if (dwReason == DLL_PROCESS_DETACH)
     {
@@ -148,12 +149,12 @@
   return TRUE;
 }
 
-static BOOL __DllMainCRTStartup (HANDLE, DWORD, LPVOID);
-
-BOOL WINAPI DllMainCRTStartup (HANDLE, DWORD, LPVOID);
+static WINBOOL __DllMainCRTStartup (HANDLE, DWORD, LPVOID);
+
+WINBOOL WINAPI DllMainCRTStartup (HANDLE, DWORD, LPVOID);
 int __mingw_init_ehandler (void);
 
-BOOL WINAPI
+WINBOOL WINAPI
 DllMainCRTStartup (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved)
 {
   mingw_app_type = 0;
@@ -167,10 +168,10 @@
   return __DllMainCRTStartup (hDllHandle, dwReason, lpreserved);
 }
 
-__declspec(noinline) BOOL
+__declspec(noinline) WINBOOL
 __DllMainCRTStartup (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved)
 {
-  BOOL retcode = TRUE;
+  WINBOOL retcode = TRUE;
 
   __native_dllmain_reason = dwReason;
   if (dwReason == DLL_PROCESS_DETACH && __proc_attached == 0)

Added: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crtend.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crtend.c?rev=46537&view=auto
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crtend.c (added)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crtend.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -1,0 +1,6 @@
+/**
+ * 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.PD within this package.
+ */
+

Propchange: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crtend.c
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crtexe.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crtexe.c?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crtexe.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/crtexe.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -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
@@ -20,7 +20,6 @@
 #include <tchar.h>
 #include <sect_attribs.h>
 #include <locale.h>
-#include <intrin.h>
 
 #ifndef __winitenv
 extern wchar_t *** __MINGW_IMP_SYMBOL(__winitenv);
@@ -31,6 +30,11 @@
 extern char *** __MINGW_IMP_SYMBOL(__initenv);
 #define __initenv (* __MINGW_IMP_SYMBOL(__initenv))
 #endif
+
+/* Hack, for bug in ld.  Will be removed soon.  */
+#define __ImageBase __MINGW_LSYMBOL(_image_base__)
+/* This symbol is defined by ld.  */
+extern IMAGE_DOS_HEADER __ImageBase;
 
 extern void _fpreset (void);
 #define SPACECHAR _T(' ')
@@ -47,11 +51,7 @@
 #define _commode (* __MINGW_IMP_SYMBOL(_commode))
 extern int _dowildcard;
 
-#if defined(__GNUC__)
 int _MINGW_INSTALL_DEBUG_MATHERR __attribute__((weak)) = 0;
-#else
-int _MINGW_INSTALL_DEBUG_MATHERR = 0;
-#endif
 extern int __defaultmatherr;
 extern _CRTIMP void __cdecl _initterm(_PVFV *, _PVFV *);
 
@@ -62,6 +62,7 @@
 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;
@@ -179,7 +180,7 @@
 {
   _TCHAR *lpszCommandLine = NULL;
   STARTUPINFO StartupInfo;
-  BOOL inDoubleQuote = FALSE;
+  WINBOOL inDoubleQuote = FALSE;
   memset (&StartupInfo, 0, sizeof (STARTUPINFO));
   
   if (mingw_app_type)

Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/dll_argv.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/dll_argv.c?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/dll_argv.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/dll_argv.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -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.
  */
 
 #ifdef CRTDLL

Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/dllargv.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/dllargv.c?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/dllargv.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/dllargv.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -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.
  */
 
 #ifdef CRTDLL

Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/dllentry.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/dllentry.c?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/dllentry.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/dllentry.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -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.
  */
 
 #include <oscalls.h>

Removed: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/dummy_mingwthrd.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/dummy_mingwthrd.c?rev=46536&view=auto
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/dummy_mingwthrd.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/dummy_mingwthrd.c (removed)
@@ -1,148 +1,0 @@
-/*
- * mthr_stub.c
- *
- * Implement Mingw-w64 thread-support.
- *
- * This file is used by if gcc is built with --enable-threads=win32. 
- *
- * Based on version created by Mumit Khan  <khan at nanotech.wisc.edu>
- *
- */
-
-#ifndef WIN32_LEAN_AND_MEAN
-#define WIN32_LEAN_AND_MEAN
-#endif
-#include <windows.h>
-#include <stdlib.h>
-
-BOOL __mingw_TLScallback (HANDLE hDllHandle, DWORD reason, LPVOID reserved);
-int ___w64_mingwthr_remove_key_dtor (DWORD key);
-int ___w64_mingwthr_add_key_dtor (DWORD key, void (*dtor)(void *));
-
-/* To protect the thread/key association data structure modifications. */
-static CRITICAL_SECTION __mingwthr_cs;
-static volatile int __mingwthr_cs_init = 0;
-
-typedef struct __mingwthr_key __mingwthr_key_t;
-
-/* The list of threads active with key/dtor pairs. */
-struct __mingwthr_key {
-  DWORD key;
-  void (*dtor)(void *);
-  __mingwthr_key_t volatile *next;
-};
-
-
-static __mingwthr_key_t volatile *key_dtor_list;
-
-int
-___w64_mingwthr_add_key_dtor (DWORD key, void (*dtor)(void *))
-{
-  __mingwthr_key_t *new_key;
-
-  if (__mingwthr_cs_init == 0)
-    return 0;
-  new_key = (__mingwthr_key_t *)malloc(sizeof (__mingwthr_key_t));
-
-  if (new_key == NULL)
-    return -1;
-
-  memset(new_key, 0,sizeof (__mingwthr_key_t));
-  new_key->key = key;
-  new_key->dtor = dtor;
-
-  EnterCriticalSection (&__mingwthr_cs);
-
-  new_key->next = key_dtor_list;
-  key_dtor_list = new_key;
-
-  LeaveCriticalSection (&__mingwthr_cs);
-  return 0;
-}
-
-int
-___w64_mingwthr_remove_key_dtor (DWORD key)
-{
-  __mingwthr_key_t volatile *prev_key;
-  __mingwthr_key_t volatile *cur_key;
-
-  if (__mingwthr_cs_init == 0)
-    return 0;
-
-  EnterCriticalSection (&__mingwthr_cs);
-
-  prev_key = NULL;
-  cur_key = key_dtor_list;
-
-  while (cur_key != NULL)
-    {
-      if ( cur_key->key == key)
-        {
-          if (prev_key == NULL)
-            key_dtor_list = cur_key->next;
-          else
-            prev_key->next = cur_key->next;
-
-          free ((void*)cur_key);
-          break;
-        }
-      prev_key = cur_key;
-      cur_key = cur_key->next;
-    }
-
-  LeaveCriticalSection (&__mingwthr_cs);
-  return 0;
-}
-
-static void
-__mingwthr_run_key_dtors (void)
-{
-  __mingwthr_key_t volatile *keyp;
-
-  if (__mingwthr_cs_init == 0)
-    return;
-  EnterCriticalSection (&__mingwthr_cs);
-
-  for (keyp = key_dtor_list; keyp; )
-    {
-      LPVOID value = TlsGetValue (keyp->key);
-      if (GetLastError () == ERROR_SUCCESS)
-        {
-          if (value)
-            (*keyp->dtor) (value);
-        }
-      keyp = keyp->next;
-    }
-
-  LeaveCriticalSection (&__mingwthr_cs);
-}
-  
-BOOL
-__mingw_TLScallback (HANDLE hDllHandle __attribute__ ((__unused__)),
-		     DWORD reason,
-		     LPVOID reserved __attribute__ ((__unused__)))
-{
-  switch (reason)
-    {
-    case DLL_PROCESS_ATTACH:
-      if (__mingwthr_cs_init == 0)
-        InitializeCriticalSection (&__mingwthr_cs);
-      __mingwthr_cs_init = 1;
-      break;
-    case DLL_PROCESS_DETACH:
-      __mingwthr_run_key_dtors();
-      if (__mingwthr_cs_init == 1)
-        {
-          __mingwthr_cs_init = 0;
-          DeleteCriticalSection (&__mingwthr_cs);
-        }
-      break;
-    case DLL_THREAD_ATTACH:
-      break;
-    case DLL_THREAD_DETACH:
-      __mingwthr_run_key_dtors();
-      break;
-    }
-  return TRUE;
-}
-

Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/gccmain.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/gccmain.c?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/gccmain.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/gccmain.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -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.
  */
 
 #include <windows.h>

Removed: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/getopt.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/getopt.c?rev=46536&view=auto
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/getopt.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/getopt.c (removed)
@@ -1,394 +1,0 @@
-#include <assert.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-#include <getopt.h>
-#include <stdarg.h>
-#include <stdio.h>
-
-#define REPLACE_GETOPT
-
-#define _DIAGASSERT(x) do {} while (0)
-
-#ifdef REPLACE_GETOPT
-#ifdef __weak_alias
-__weak_alias(getopt,_getopt)
-#endif
-int opterr = 1;
-int optind = 1;
-int optopt = '?';
-int optreset;
-char *optarg;
-#endif
-
-#ifdef __weak_alias
-__weak_alias(getopt_long,_getopt_long)
-#endif
-
-#ifndef __CYGWIN__
-#define __progname __argv[0]
-#else
-extern char __declspec(dllimport) *__progname;
-#endif
-
-#define IGNORE_FIRST (*options == '-' || *options == '+')
-#define PRINT_ERROR ((opterr) && ((*options != ':') || (IGNORE_FIRST && options[1] != ':')))
-
-#ifndef IS_POSIXLY_CORRECT
-#define IS_POSIXLY_CORRECT (getenv("POSIXLY_CORRECT") != NULL)
-#endif
-
-#define PERMUTE (!IS_POSIXLY_CORRECT && !IGNORE_FIRST)
-
-#define IN_ORDER (!IS_POSIXLY_CORRECT && *options == '-')
-
-#define BADCH (int)'?'
-#define BADARG ((IGNORE_FIRST && options[1] == ':') || (*options == ':') ? (int)':' : (int)'?')
-#define INORDER (int)1
-
-static char EMSG[1];
-
-static int getopt_internal (int,char * const *,const char *);
-static int gcd (int,int);
-static void permute_args (int,int,int,char * const *);
-
-static char *place = EMSG;
-
-static int nonopt_start = -1;
-static int nonopt_end = -1;
-
-static const char recargchar[] = "option requires an argument -- %c";
-static const char recargstring[] = "option requires an argument -- %s";
-static const char ambig[] = "ambiguous option -- %.*s";
-static const char noarg[] = "option doesn't take an argument -- %.*s";
-static const char illoptchar[] = "unknown option -- %c";
-static const char illoptstring[] = "unknown option -- %s";
-
-static void
-_vwarnx(const char *fmt,va_list ap)
-{
-  (void)fprintf(stderr,"%s: ",__progname);
-  if (fmt != NULL)
-    (void)vfprintf(stderr,fmt,ap);
-  (void)fprintf(stderr,"\n");
-}
-
-static void
-warnx(const char *fmt,...)
-{
-  va_list ap;
-  va_start(ap,fmt);
-  _vwarnx(fmt,ap);
-  va_end(ap);
-}
-
-static int
-gcd(a,b)
-	int a;
-	int b;
-{
-	int c;
-
-	c = a % b;
-	while (c != 0) {
-		a = b;
-		b = c;
-		c = a % b;
-	}
-
-	return b;
-}
-
-static void
-permute_args(panonopt_start,panonopt_end,opt_end,nargv)
-	int panonopt_start;
-	int panonopt_end;
-	int opt_end;
-	char * const *nargv;
-{
-	int cstart,cyclelen,i,j,ncycle,nnonopts,nopts,pos;
-	char *swap;
-
-	_DIAGASSERT(nargv != NULL);
-
-	nnonopts = panonopt_end - panonopt_start;
-	nopts = opt_end - panonopt_end;
-	ncycle = gcd(nnonopts,nopts);
-	cyclelen = (opt_end - panonopt_start) / ncycle;
-
-	for (i = 0; i < ncycle; i++) {
-		cstart = panonopt_end+i;
-		pos = cstart;
-		for (j = 0; j < cyclelen; j++) {
-			if (pos >= panonopt_end)
-				pos -= nnonopts;
-			else
-				pos += nopts;
-			swap = nargv[pos];
-
-			((char **) nargv)[pos] = nargv[cstart];
-
-			((char **)nargv)[cstart] = swap;
-		}
-	}
-}
-
-static int
-getopt_internal(nargc,nargv,options)
-	int nargc;
-	char * const *nargv;
-	const char *options;
-{
-	char *oli;
-	int optchar;
-
-	_DIAGASSERT(nargv != NULL);
-	_DIAGASSERT(options != NULL);
-
-	optarg = NULL;
-
-	if (optind == 0)
-		optind = 1;
-
-	if (optreset)
-		nonopt_start = nonopt_end = -1;
-start:
-	if (optreset || !*place) {
-		optreset = 0;
-		if (optind >= nargc) {
-			place = EMSG;
-			if (nonopt_end != -1) {
-
-				permute_args(nonopt_start,nonopt_end,optind,nargv);
-				optind -= nonopt_end - nonopt_start;
-			}
-			else if (nonopt_start != -1) {
-
-				optind = nonopt_start;
-			}
-			nonopt_start = nonopt_end = -1;
-			return -1;
-		}
-		if ((*(place = nargv[optind]) != '-')
-		    || (place[1] == '\0')) {
-			place = EMSG;
-			if (IN_ORDER) {
-
-				optarg = nargv[optind++];
-				return INORDER;
-			}
-			if (!PERMUTE) {
-
-				return -1;
-			}
-
-			if (nonopt_start == -1)
-				nonopt_start = optind;
-			else if (nonopt_end != -1) {
-				permute_args(nonopt_start,nonopt_end,optind,nargv);
-				nonopt_start = optind -
-				    (nonopt_end - nonopt_start);
-				nonopt_end = -1;
-			}
-			optind++;
-
-			goto start;
-		}
-		if (nonopt_start != -1 && nonopt_end == -1)
-			nonopt_end = optind;
-		if (place[1] && *++place == '-') {
-			place++;
-			return -2;
-		}
-	}
-	if ((optchar = (int)*place++) == (int)':' ||
-	    (oli = strchr(options + (IGNORE_FIRST ? 1 : 0),optchar)) == NULL) {
-
-		if (!*place)
-			++optind;
-		if (PRINT_ERROR)
-			warnx(illoptchar,optchar);
-		optopt = optchar;
-		return BADCH;
-	}
-	if (optchar == 'W' && oli[1] == ';') {
-
-		if (*place)
-			return -2;
-
-		if (++optind >= nargc) {
-			place = EMSG;
-			if (PRINT_ERROR)
-				warnx(recargchar,optchar);
-			optopt = optchar;
-			return BADARG;
-		} else
-			place = nargv[optind];
-
-		return -2;
-	}
-	if (*++oli != ':') {
-		if (!*place)
-			++optind;
-	} else {
-		optarg = NULL;
-		if (*place)
-			optarg = place;
-
-		else if (oli[1] != ':') {
-			if (++optind >= nargc) {
-				place = EMSG;
-				if (PRINT_ERROR)
-					warnx(recargchar,optchar);
-				optopt = optchar;
-				return BADARG;
-			} else
-				optarg = nargv[optind];
-		}
-		place = EMSG;
-		++optind;
-	}
-
-	return optchar;
-}
-
-#ifdef REPLACE_GETOPT
-
-int
-getopt(nargc,nargv,options)
-	int nargc;
-	char * const *nargv;
-	const char *options;
-{
-	int retval;
-
-	_DIAGASSERT(nargv != NULL);
-	_DIAGASSERT(options != NULL);
-
-	if ((retval = getopt_internal(nargc,nargv,options)) == -2) {
-		++optind;
-
-		if (nonopt_end != -1) {
-			permute_args(nonopt_start,nonopt_end,optind,nargv);
-			optind -= nonopt_end - nonopt_start;
-		}
-		nonopt_start = nonopt_end = -1;
-		retval = -1;
-	}
-	return retval;
-}
-#endif
-
-int
-getopt_long(nargc,nargv,options,long_options,idx)
-	int nargc;
-	char * const *nargv;
-	const char *options;
-	const struct option *long_options;
-	int *idx;
-{
-	int retval;
-
-	_DIAGASSERT(nargv != NULL);
-	_DIAGASSERT(options != NULL);
-	_DIAGASSERT(long_options != NULL);
-
-	if ((retval = getopt_internal(nargc,nargv,options)) == -2) {
-		char *current_argv,*has_equal;
-		size_t current_argv_len;
-		int i,match;
-
-		current_argv = place;
-		match = -1;
-
-		optind++;
-		place = EMSG;
-
-		if (*current_argv == '\0') {
-
-			if (nonopt_end != -1) {
-				permute_args(nonopt_start,nonopt_end,optind,nargv);
-				optind -= nonopt_end - nonopt_start;
-			}
-			nonopt_start = nonopt_end = -1;
-			return -1;
-		}
-		if ((has_equal = strchr(current_argv,'=')) != NULL) {
-
-			current_argv_len = has_equal - current_argv;
-			has_equal++;
-		} else
-			current_argv_len = strlen(current_argv);
-
-		for (i = 0; long_options[i].name; i++) {
-
-			if (strncmp(current_argv,long_options[i].name,current_argv_len))
-				continue;
-
-			if (strlen(long_options[i].name) ==
-			    (unsigned)current_argv_len) {
-
-				match = i;
-				break;
-			}
-			if (match == -1)
-				match = i;
-			else {
-
-				if (PRINT_ERROR)
-					warnx(ambig,(int)current_argv_len,current_argv);
-				optopt = 0;
-				return BADCH;
-			}
-		}
-		if (match != -1) {
-			if (long_options[match].has_arg == no_argument
-			    && has_equal) {
-				if (PRINT_ERROR)
-					warnx(noarg,(int)current_argv_len,current_argv);
-
-				if (long_options[match].flag == NULL)
-					optopt = long_options[match].val;
-				else
-					optopt = 0;
-				return BADARG;
-			}
-			if (long_options[match].has_arg == required_argument ||
-			    long_options[match].has_arg == optional_argument) {
-				if (has_equal)
-					optarg = has_equal;
-				else if (long_options[match].has_arg ==
-				    required_argument) {
-
-					optarg = nargv[optind++];
-				}
-			}
-			if ((long_options[match].has_arg == required_argument)
-			    && (optarg == NULL)) {
-
-				if (PRINT_ERROR)
-					warnx(recargstring,current_argv);
-
-				if (long_options[match].flag == NULL)
-					optopt = long_options[match].val;
-				else
-					optopt = 0;
-				--optind;
-				return BADARG;
-			}
-		} else {
-			if (PRINT_ERROR)
-				warnx(illoptstring,current_argv);
-			optopt = 0;
-			return BADCH;
-		}
-		if (long_options[match].flag) {
-			*long_options[match].flag = long_options[match].val;
-			retval = 0;
-		} else
-			retval = long_options[match].val;
-		if (idx)
-			*idx = match;
-	}
-	return retval;
-}

Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/gs_support.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/gs_support.c?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/gs_support.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/gs_support.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -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.
  */
 
 #include <windows.h>
@@ -112,22 +112,12 @@
   else
 #endif
     {
-#ifdef __GNUC__
 #ifdef _WIN64
       GS_ContextRecord.Rip = (ULONGLONG) __builtin_return_address (0);
       GS_ContextRecord.Rsp = (ULONGLONG) __builtin_frame_address (0) + 8;
 #else
       GS_ContextRecord.Eip = (DWORD) __builtin_return_address (0);
       GS_ContextRecord.Esp = (DWORD) __builtin_frame_address (0) + 4;
-#endif
-#else
-#ifdef _WIN64
-      GS_ContextRecord.Rip = (ULONGLONG) _ReturnAddress();
-      GS_ContextRecord.Rsp = (ULONGLONG) _AddressOfReturnAddress();
-#else
-      GS_ContextRecord.Eip = (DWORD) _ReturnAddress();
-      GS_ContextRecord.Esp = (DWORD) _AddressOfReturnAddress();
-#endif
 #endif
     }
 

Added: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/isascii.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/isascii.c?rev=46537&view=auto
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/isascii.c (added)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/isascii.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -1,0 +1,16 @@
+/**
+ * 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.PD within this package.
+ */
+
+#include <ctype.h>
+
+#undef isascii
+int isascii (int);
+
+int
+isascii (int c)
+{
+	return __isascii(c);
+}

Propchange: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/isascii.c
------------------------------------------------------------------------------
    svn:eol-style = native

Added: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/iscsym.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/iscsym.c?rev=46537&view=auto
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/iscsym.c (added)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/iscsym.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -1,0 +1,16 @@
+/**
+ * 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.PD within this package.
+ */
+
+#include <ctype.h>
+#undef iscsym
+
+int iscsym (int);
+
+int
+iscsym (int c)
+{
+	return __iscsym(c);
+}

Propchange: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/iscsym.c
------------------------------------------------------------------------------
    svn:eol-style = native

Added: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/iscsymf.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/iscsymf.c?rev=46537&view=auto
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/iscsymf.c (added)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/iscsymf.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -1,0 +1,16 @@
+/**
+ * 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.PD within this package.
+ */
+
+#include <ctype.h>
+#undef iscsymf
+
+int iscsymf (int);
+
+int
+iscsymf (int c)
+{
+	return __iscsymf(c);
+}

Propchange: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/iscsymf.c
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/merr.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/merr.c?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/merr.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/merr.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -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.
  */
 
 #include <internal.h>

Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/mingw.rbuild
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/mingw.rbuild?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/mingw.rbuild [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/mingw.rbuild [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -3,6 +3,10 @@
 <group>
 <module name="mingw_common" type="staticlibrary" isstartuplib="true" crt="dll">
 	<define name="_CRTBLD" />
+
+	<!-- This is to prevent from using data imports directly -->
+	<define name="_M_CEE_PURE" />
+
 	<importlibrary definition="moldname-msvcrt.def" dllname="msvcrt.dll" />
 	<include base="ReactOS">include/reactos/mingw-w64</include>
 	<if property="USERMODE" value="1">
@@ -18,19 +22,18 @@
 	<file>CRT_glob.c</file>
 	<file>crt_handler.c</file>
 	<file>dllentry.c</file>
-	<file>dummy_mingwthrd.c</file>
 	<file>gccmain.c</file>
-	<file>getopt.c</file>
 	<file>gs_support.c</file>
 	<file>merr.c</file>
 	<!-- file>mingw_custom.c</file -->
 	<file>mingw_helpers.c</file>
-	<file>mingwthrd_nomt.c</file>
 	<file>natstart.c</file>
 	<file>pesect.c</file>
 	<file>pseudo-reloc.c</file>
 	<file>pseudo-reloc-list.c</file>
+	<file>tlsmcrt.c</file>
 	<file>tlssup.c</file>
+	<file>tlsthrd.c</file>
 	<file>txtmode.c</file>
 	<file>wildcard.c</file>
 	<file>xncommod.c</file>

Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/mingw_custom.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/mingw_custom.c?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/mingw_custom.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/mingw_custom.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -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.
  */
 
 #include <_mingw.h>

Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/mingw_helpers.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/mingw_helpers.c?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/mingw_helpers.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/mingw_helpers.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -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.
  */
 
 #include <oscalls.h>

Removed: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/mingwthrd_nomt.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/mingwthrd_nomt.c?rev=46536&view=auto
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/mingwthrd_nomt.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/mingwthrd_nomt.c (removed)
@@ -1,30 +1,0 @@
-#ifndef WIN32_LEAN_AND_MEAN
-#define WIN32_LEAN_AND_MEAN
-#endif
-#include <windows.h>
-#include <stdlib.h>
-
-/* We support TLS cleanup code in any case. If shared version of libgcc is used _CRT_MT has value 1, otherwise
-   we do tls cleanup in runtime and _CRT_MT has value 2.  */
-int _CRT_MT = 2;
-
-int __mingwthr_key_dtor (DWORD key, void (*dtor)(void *));
-int __mingwthr_remove_key_dtor (DWORD key);
-
-extern int ___w64_mingwthr_remove_key_dtor (DWORD key);
-extern int ___w64_mingwthr_add_key_dtor (DWORD key, void (*dtor)(void *));
-
-int
-__mingwthr_remove_key_dtor (DWORD key)
-{
-   return ___w64_mingwthr_remove_key_dtor (key);
-}
-
-int
-__mingwthr_key_dtor (DWORD key, void (*dtor)(void *))
-{
-  if (dtor)
-    return ___w64_mingwthr_add_key_dtor (key, dtor);
-
-  return 0;
-}

Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/natstart.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/natstart.c?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/natstart.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/natstart.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -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.
  */
 
 #include <crtdefs.h>

Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/pesect.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/pesect.c?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/pesect.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/pesect.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -1,15 +1,24 @@
 /**
  * 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.
  */
 
 #include <windows.h>
 #include <string.h>
 
-BOOL _ValidateImageBase (PBYTE);
+#if defined (_WIN64) && defined (__ia64__)
+#error FIXME: Unsupported __ImageBase implementation.
+#else
+/* Hack, for bug in ld.  Will be removed soon.  */
+#define __ImageBase __MINGW_LSYMBOL(_image_base__)
+/* This symbol is defined by the linker.  */
+extern IMAGE_DOS_HEADER __ImageBase;
+#endif
 
-BOOL
+WINBOOL _ValidateImageBase (PBYTE);
+
+WINBOOL
 _ValidateImageBase (PBYTE pImageBase)
 {
   PIMAGE_DOS_HEADER pDOSHeader;
@@ -122,9 +131,9 @@
   return pImageBase;
 }
 
-BOOL _IsNonwritableInCurrentImage (PBYTE);
+WINBOOL _IsNonwritableInCurrentImage (PBYTE);
 
-BOOL
+WINBOOL
 _IsNonwritableInCurrentImage (PBYTE pTarget)
 {
   PBYTE pImageBase;

Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/pseudo-reloc-list.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/pseudo-reloc-list.c?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/pseudo-reloc-list.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/pseudo-reloc-list.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -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.
  */
 
 char __RUNTIME_PSEUDO_RELOC_LIST_END__ = 0;

Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/pseudo-reloc.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/pseudo-reloc.c?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/pseudo-reloc.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/pseudo-reloc.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -1,27 +1,71 @@
-/**
- * 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.
- *
- * Contributed by Egor Duda  <deo at logos-m.ru>
- * Modified by addition of runtime_pseudo_reloc version 2
- * by Kai Tietz  <kai.tietz at onevision.com>
- */
+/* pseudo-reloc.c
+
+   Contributed by Egor Duda  <deo at logos-m.ru>
+   Modified by addition of runtime_pseudo_reloc version 2
+   by Kai Tietz  <kai.tietz at onevision.com>
+	
+   THIS SOFTWARE IS NOT COPYRIGHTED
+
+   This source code is offered for use in the public domain. You may
+   use, modify or distribute it freely.
+
+   This code is distributed in the hope that it will be useful but
+   WITHOUT ANY WARRANTY. ALL WARRENTIES, EXPRESS OR IMPLIED ARE HEREBY
+   DISCLAMED. This includes but is not limited to warrenties of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+*/
 
 #include <windows.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <stdarg.h>
 #include <memory.h>
-#include <assert.h>
+
+#if defined(__CYGWIN__)
+#include <wchar.h>
+#include <ntdef.h>
+#include <sys/cygwin.h>
+/* copied from winsup.h */
+# define NO_COPY __attribute__((nocommon)) __attribute__((section(".data_cygwin_nocopy")))
+/* custom status code: */
+#define STATUS_ILLEGAL_DLL_PSEUDO_RELOCATION ((NTSTATUS) 0xe0000269)
+#define SHORT_MSG_BUF_SZ 128
+#else
+# define NO_COPY
+#endif
+
+#ifdef __GNUC__
+#define ATTRIBUTE_NORETURN __attribute__ ((noreturn))
+#else
+#define ATTRIBUTE_NORETURN
+#endif
+
+#ifndef __MINGW_LSYMBOL
+#define __MINGW_LSYMBOL(sym) sym
+#endif
 
 extern char __RUNTIME_PSEUDO_RELOC_LIST__;
 extern char __RUNTIME_PSEUDO_RELOC_LIST_END__;
-
+extern char __MINGW_LSYMBOL(_image_base__);
+
+void _pei386_runtime_relocator (void);
+
+/* v1 relocation is basically:
+ *   *(base + .target) += .addend
+ * where (base + .target) is always assumed to point
+ * to a DWORD (4 bytes).
+ */
 typedef struct {
   DWORD addend;
   DWORD target;
 } runtime_pseudo_reloc_item_v1;
 
+/* v2 relocation is more complex. In effect, it is
+ *    *(base + .target) += *(base + .sym) - (base + .sym)
+ * with care taken in both reading, sign extension, and writing
+ * because .flags may indicate that (base + .target) may point
+ * to a BYTE, WORD, DWORD, or QWORD (w64).
+ */
 typedef struct {
   DWORD sym;
   DWORD target;
@@ -29,24 +73,123 @@
 } runtime_pseudo_reloc_item_v2;
 
 typedef struct {
-	DWORD magic1;
-	DWORD magic2;
-	DWORD version;
+  DWORD magic1;
+  DWORD magic2;
+  DWORD version;
 } runtime_pseudo_reloc_v2;
 
+static void ATTRIBUTE_NORETURN
+__report_error (const char *msg, ...)
+{
+#ifdef __CYGWIN__
+  /* This function is used to print short error messages
+   * to stderr, which may occur during DLL initialization
+   * while fixing up 'pseudo' relocations. This early, we
+   * may not be able to use cygwin stdio functions, so we
+   * use the win32 WriteFile api. This should work with both
+   * normal win32 console IO handles, redirected ones, and
+   * cygwin ptys.
+   */
+  char buf[SHORT_MSG_BUF_SZ];
+  wchar_t module[MAX_PATH];
+  char * posix_module = NULL;
+  static const char   UNKNOWN_MODULE[] = "<unknown module>: ";
+  static const size_t UNKNOWN_MODULE_LEN = sizeof (UNKNOWN_MODULE) - 1;
+  static const char   CYGWIN_FAILURE_MSG[] = "Cygwin runtime failure: ";
+  static const size_t CYGWIN_FAILURE_MSG_LEN = sizeof (CYGWIN_FAILURE_MSG) - 1;
+  DWORD len;
+  DWORD done;
+  va_list args;
+  HANDLE errh = GetStdHandle (STD_ERROR_HANDLE);
+  ssize_t modulelen = GetModuleFileNameW (NULL, module, sizeof (module));
+
+  if (errh == INVALID_HANDLE_VALUE)
+    cygwin_internal (CW_EXIT_PROCESS,
+                     STATUS_ILLEGAL_DLL_PSEUDO_RELOCATION,
+                     1);
+
+  if (modulelen > 0)
+    posix_module = cygwin_create_path (CCP_WIN_W_TO_POSIX, module);
+
+  va_start (args, msg);
+  len = (DWORD) vsnprintf (buf, SHORT_MSG_BUF_SZ, msg, args);
+  va_end (args);
+  buf[SHORT_MSG_BUF_SZ-1] = '\0'; /* paranoia */
+
+  if (posix_module)
+    {
+      WriteFile (errh, (PCVOID)CYGWIN_FAILURE_MSG,
+                 CYGWIN_FAILURE_MSG_LEN, &done, NULL);
+      WriteFile (errh, (PCVOID)posix_module,
+                 strlen(posix_module), &done, NULL);
+      WriteFile (errh, (PCVOID)": ", 2, &done, NULL);
+      WriteFile (errh, (PCVOID)buf, len, &done, NULL);
+      free (posix_module);
+    }
+  else
+    {
+      WriteFile (errh, (PCVOID)CYGWIN_FAILURE_MSG,
+                 CYGWIN_FAILURE_MSG_LEN, &done, NULL);
+      WriteFile (errh, (PCVOID)UNKNOWN_MODULE,
+                 UNKNOWN_MODULE_LEN, &done, NULL);
+      WriteFile (errh, (PCVOID)buf, len, &done, NULL);
+    }
+  WriteFile (errh, (PCVOID)"\n", 1, &done, NULL);
+
+  cygwin_internal (CW_EXIT_PROCESS,
+                   STATUS_ILLEGAL_DLL_PSEUDO_RELOCATION,
+                   1);
+  /* not reached, but silences noreturn warning */
+  abort ();
+#else
+  va_list argp;
+  va_start (argp, msg);
+# ifdef __MINGW64_VERSION_MAJOR
+  fprintf (stderr, "Mingw-w64 runtime failure:\n");
+# else
+  fprintf (stderr, "Mingw runtime failure:\n");
+# endif
+  vfprintf (stderr, msg, argp);
+  va_end (argp);
+  abort ();
+#endif
+}
+
+/* This function temporarily marks the page containing addr
+ * writable, before copying len bytes from *src to *addr, and
+ * then restores the original protection settings to the page.
+ *
+ * Using this function eliminates the requirement with older
+ * pseudo-reloc implementations, that sections containing
+ * pseudo-relocs (such as .text and .rdata) be permanently
+ * marked writable. This older behavior sabotaged any memory
+ * savings achieved by shared libraries on win32 -- and was
+ * slower, too.  However, on cygwin as of binutils 2.20 the
+ * .text section is still marked writable, and the .rdata section
+ * is folded into the (writable) .data when --enable-auto-import.
+ */
 static void
 __write_memory (void *addr, const void *src, size_t len)
 {
   MEMORY_BASIC_INFORMATION b;
   DWORD oldprot;
+
   if (!len)
     return;
-  assert (VirtualQuery (addr, &b, sizeof(b)));
+
+  if (!VirtualQuery (addr, &b, sizeof(b)))
+    {
+      __report_error ("  VirtualQuery failed for %d bytes at address %p",
+		      (int) sizeof(b), addr);
+    }
+
   /* Temporarily allow write access to read-only protected memory.  */
   if (b.Protect != PAGE_EXECUTE_READWRITE && b.Protect != PAGE_READWRITE)
     VirtualProtect (b.BaseAddress, b.RegionSize, PAGE_EXECUTE_READWRITE,
 		  &oldprot);
+  /* write the data. */
   memcpy (addr, src, len);
+  /* Restore original protection. */
   if (b.Protect != PAGE_EXECUTE_READWRITE && b.Protect != PAGE_READWRITE)
     VirtualProtect (b.BaseAddress, b.RegionSize, oldprot, &oldprot);
 }
@@ -55,66 +198,122 @@
 #define RP_VERSION_V2 1
 
 static void
-do_pseudo_reloc (void *start, void *end, void *base)
+do_pseudo_reloc (void * start, void * end, void * base)
 {
   ptrdiff_t addr_imp, reldata;
   ptrdiff_t reloc_target = (ptrdiff_t) ((char *)end - (char*)start);
   runtime_pseudo_reloc_v2 *v2_hdr = (runtime_pseudo_reloc_v2 *) start;
   runtime_pseudo_reloc_item_v2 *r;
 
+  /* A valid relocation list will contain at least one entry, and
+   * one v1 data structure (the smallest one) requires two DWORDs.
+   * So, if the relocation list is smaller than 8 bytes, bail.
+   */
   if (reloc_target < 8)
     return;
-  /* Check if this is old version pseudo relocation version.  */
+
+  /* Check if this is the old pseudo relocation version.  */
+  /* There are two kinds of v1 relocation lists:
+   *   1) With a (v2-style) version header. In this case, the
+   *      first entry in the list is a 3-DWORD structure, with
+   *      value:
+   *         { 0, 0, RP_VERSION_V1 }
+   *      In this case, we skip to the next entry in the list,
+   *      knowing that all elements after the head item can
+   *      be cast to runtime_pseudo_reloc_item_v1.
+   *   2) Without a (v2-style) version header. In this case, the
+   *      first element in the list IS an actual v1 relocation
+   *      record, which is two DWORDs.  Because there will never
+   *      be a case where a v1 relocation record has both
+   *      addend == 0 and target == 0, this case will not be
+   *      confused with the prior one.
+   * All current binutils, when generating a v1 relocation list,
+   * use the second (e.g. original) form -- that is, without the
+   * v2-style version header.
+   */
   if (reloc_target >= 12
       && v2_hdr->magic1 == 0 && v2_hdr->magic2 == 0
       && v2_hdr->version == RP_VERSION_V1)
+    {
+      /* We have a list header item indicating that the rest
+       * of the list contains v1 entries.  Move the pointer to
+       * the first true v1 relocation record.  By definition,
+       * that v1 element will not have both addend == 0 and
+       * target == 0 (and thus, when interpreted as a
+       * runtime_pseudo_reloc_v2, it will not have both
+       * magic1 == 0 and magic2 == 0).
+       */
       v2_hdr++;
+    }
+
   if (v2_hdr->magic1 != 0 || v2_hdr->magic2 != 0)
     {
-      runtime_pseudo_reloc_item_v1 *o;
-      for (o = (runtime_pseudo_reloc_item_v1 *) v2_hdr; o < (runtime_pseudo_reloc_item_v1 *)end; o++)
-        {
-          DWORD newval;
+      /*************************
+       * Handle v1 relocations *
+       *************************/
+      runtime_pseudo_reloc_item_v1 * o;
+      for (o = (runtime_pseudo_reloc_item_v1 *) v2_hdr;
+	   o < (runtime_pseudo_reloc_item_v1 *)end;
+           o++)
+	{
+	  DWORD newval;
 	  reloc_target = (ptrdiff_t) base + o->target;
 	  newval = (*((DWORD*) reloc_target)) + o->addend;
 	  __write_memory ((void *) reloc_target, &newval, sizeof(DWORD));
-        }
+	}
       return;
     }
+
+  /* If we got this far, then we have relocations of version 2 or newer */
+
   /* Check if this is a known version.  */
   if (v2_hdr->version != RP_VERSION_V2)
     {
-#ifdef DEBUG
-      fprintf (stderr, "pseudo_relocation protocol version %d is unknown to this runtime.\n",
-	       (int) v2_hdr->version);
-#endif
+      __report_error ("  Unknown pseudo relocation protocol version %d.\n",
+		      (int) v2_hdr->version);
       return;
     }
-  /* Walk over header.  */
+
+  /*************************
+   * Handle v2 relocations *
+   *************************/
+
+  /* Walk over header. */
   r = (runtime_pseudo_reloc_item_v2 *) &v2_hdr[1];
 
   for (; r < (runtime_pseudo_reloc_item_v2 *) end; r++)
     {
+      /* location where new address will be written */
       reloc_target = (ptrdiff_t) base + r->target;
+
+      /* get sym pointer. It points either to the iat entry
+       * of the referenced element, or to the stub function.
+       */
       addr_imp = (ptrdiff_t) base + r->sym;
       addr_imp = *((ptrdiff_t *) addr_imp);
 
-      switch ((r->flags&0xff))
+      /* read existing relocation value from image, casting to the
+       * bitsize indicated by the 8 LSBs of flags. If the value is
+       * negative, manually sign-extend to ptrdiff_t width. Raise an
+       * error if the bitsize indicated by the 8 LSBs of flags is not
+       * supported.
+       */
+      switch ((r->flags & 0xff))
         {
           case 8:
 	    reldata = (ptrdiff_t) (*((unsigned char *)reloc_target));
-	    if ((reldata&0x80) != 0)
+	    if ((reldata & 0x80) != 0)
 	      reldata |= ~((ptrdiff_t) 0xff);
 	    break;
 	  case 16:
 	    reldata = (ptrdiff_t) (*((unsigned short *)reloc_target));
-	    if ((reldata&0x8000) != 0)
+	    if ((reldata & 0x8000) != 0)
 	      reldata |= ~((ptrdiff_t) 0xffff);
 	    break;
 	  case 32:
 	    reldata = (ptrdiff_t) (*((unsigned int *)reloc_target));
 #ifdef _WIN64
-	    if ((reldata&0x80000000) != 0)
+	    if ((reldata & 0x80000000) != 0)
 	      reldata |= ~((ptrdiff_t) 0xffffffff);
 #endif
 	    break;
@@ -125,15 +324,18 @@
 #endif
 	  default:
 	    reldata=0;
-#ifdef DEBUG
-	    fprintf(stderr, "Unknown pseudo relocation bit size %d\n",(int) (r->flags & 0xff));
-#endif
+	    __report_error ("  Unknown pseudo relocation bit size %d.\n",
+		    (int) (r->flags & 0xff));
 	    break;
         }
+
+      /* Adjust the relocation value */
       reldata -= ((ptrdiff_t) base + r->sym);
       reldata += addr_imp;
+
+      /* Write the new relocation value back to *reloc_target */
       switch ((r->flags & 0xff))
-        {
+	{
          case 8:
            __write_memory ((void *) reloc_target, &reldata, 1);
 	   break;
@@ -148,18 +350,18 @@
            __write_memory ((void *) reloc_target, &reldata, 8);
 	   break;
 #endif
-        }
-    }
+	}
+     }
 }
-
-void _pei386_runtime_relocator (void);
 
 void
 _pei386_runtime_relocator (void)
 {
-  static int was_init = 0;
+  static NO_COPY int was_init = 0;
   if (was_init)
     return;
   ++was_init;
-  do_pseudo_reloc (&__RUNTIME_PSEUDO_RELOC_LIST__,&__RUNTIME_PSEUDO_RELOC_LIST_END__,&__ImageBase);
+  do_pseudo_reloc (&__RUNTIME_PSEUDO_RELOC_LIST__,
+		   &__RUNTIME_PSEUDO_RELOC_LIST_END__,
+		   &__MINGW_LSYMBOL(_image_base__));
 }

Added: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/strcasecmp.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/strcasecmp.c?rev=46537&view=auto
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/strcasecmp.c (added)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/strcasecmp.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -1,0 +1,16 @@
+/**
+ * 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.PD within this package.
+ */
+
+#define __CRT__NO_INLINE
+#include <string.h>
+
+#undef strcasecmp
+int strcasecmp (const char *, const char *);
+int
+strcasecmp (const char *sz1, const char *sz2)
+{
+  return _stricmp (sz1,sz2);
+}

Propchange: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/strcasecmp.c
------------------------------------------------------------------------------
    svn:eol-style = native

Added: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/strncasecmp.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/strncasecmp.c?rev=46537&view=auto
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/strncasecmp.c (added)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/strncasecmp.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -1,0 +1,17 @@
+/**
+ * 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.PD within this package.
+ */
+
+#define __CRT__NO_INLINE
+#include <string.h>
+
+#undef strncasecmp
+int strncasecmp (const char *, const char *, size_t);
+
+int
+strncasecmp (const char *sz1,const char *sz2,size_t sizeMaxCompare)
+{
+  return _strnicmp (sz1,sz2,sizeMaxCompare);
+}

Propchange: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/strncasecmp.c
------------------------------------------------------------------------------
    svn:eol-style = native

Added: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/tlsmcrt.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/tlsmcrt.c?rev=46537&view=auto
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/tlsmcrt.c (added)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/tlsmcrt.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -1,0 +1,13 @@
+/**
+ * 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.PD within this package.
+ *
+ * Written by Kai Tietz  <kai.tietz at onevision.com>
+ */
+
+/* We support TLS cleanup code in any case. If shared version of libgcc is used _CRT_MT has value 1,
+ otherwise
+   we do tls cleanup in runtime and _CRT_MT has value 2.  */
+int _CRT_MT = 2;
+

Propchange: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/tlsmcrt.c
------------------------------------------------------------------------------
    svn:eol-style = native

Added: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/tlsmthread.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/tlsmthread.c?rev=46537&view=auto
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/tlsmthread.c (added)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/tlsmthread.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -1,0 +1,59 @@
+/**
+ * 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.PD within this package.
+ *
+ * Written by Kai Tietz  <kai.tietz at onevision.com>
+ */
+#ifndef WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN
+#endif
+#include <windows.h>
+#include <stdlib.h>
+
+int __mingwthr_key_dtor (DWORD key, void (*dtor)(void *));
+int __mingwthr_remove_key_dtor (DWORD key);
+
+extern int ___w64_mingwthr_remove_key_dtor (DWORD key);
+extern int ___w64_mingwthr_add_key_dtor (DWORD key, void (*dtor)(void *));
+
+
+#ifndef _WIN64
+#define MINGWM10_DLL "mingwm10.dll"
+typedef int (*fMTRemoveKeyDtor)(DWORD key);
+typedef int (*fMTKeyDtor)(DWORD key, void (*dtor)(void *));
+extern fMTRemoveKeyDtor __mingw_gMTRemoveKeyDtor;
+extern fMTKeyDtor __mingw_gMTKeyDtor;
+extern int __mingw_usemthread_dll;
+#endif
+
+int
+__mingwthr_remove_key_dtor (DWORD key)
+{
+#ifndef _WIN64
+  if (!__mingw_usemthread_dll)
+#endif
+     return ___w64_mingwthr_remove_key_dtor (key);
+#ifndef _WIN64
+  if (__mingw_gMTRemoveKeyDtor)
+    return (*__mingw_gMTRemoveKeyDtor) (key);
+  return 0;
+#endif
+}
+
+int
+__mingwthr_key_dtor (DWORD key, void (*dtor)(void *))
+{
+  if (dtor)
+    {
+#ifndef _WIN64
+      if (!__mingw_usemthread_dll)
+#endif
+        return ___w64_mingwthr_add_key_dtor (key, dtor);
+#ifndef _WIN64
+      if (__mingw_gMTKeyDtor)
+	return (*__mingw_gMTKeyDtor) (key, dtor);
+#endif
+    }
+  return 0;
+}

Propchange: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/tlsmthread.c
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/tlssup.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/tlssup.c?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/tlssup.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/tlssup.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -1,20 +1,32 @@
 /**
  * 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.
+ *
+ * Written by Kai Tietz  <kai.tietz at onevision.com>
  */
 
 #ifdef CRTDLL
 #undef CRTDLL
 #endif
 
-#include <internal.h>
-#include <sect_attribs.h>
 #include <windows.h>
+#include <stdio.h>
+#include <memory.h>
 #include <malloc.h>
-#include <crtdbg.h>
-
-extern BOOL __mingw_TLScallback (HANDLE hDllHandle, DWORD reason, LPVOID reserved);
+
+#ifndef _CRTALLOC
+#define _CRTALLOC(x) __attribute__ ((section (x) ))
+#endif
+
+#ifndef __INTERNAL_FUNC_DEFINED
+#define __INTERNAL_FUNC_DEFINED
+  typedef void (__cdecl *_PVFV)(void);
+  typedef int (__cdecl *_PIFV)(void);
+  typedef void (__cdecl *_PVFI)(int);
+#endif
+
+extern WINBOOL __mingw_TLScallback (HANDLE hDllHandle, DWORD reason, LPVOID reserved);
 
 #define FUNCS_PER_NODE 30
 
@@ -66,6 +78,16 @@
 
 extern int _CRT_MT;
 
+#ifndef _WIN64
+#define MINGWM10_DLL "mingwm10.dll"
+typedef int (*fMTRemoveKeyDtor)(DWORD key);
+typedef int (*fMTKeyDtor)(DWORD key, void (*dtor)(void *));
+fMTRemoveKeyDtor __mingw_gMTRemoveKeyDtor;
+fMTKeyDtor __mingw_gMTKeyDtor;
+int __mingw_usemthread_dll;
+static HANDLE __mingw_mthread_hdll;
+#endif
+
 BOOL WINAPI __dyn_tls_init (HANDLE, DWORD, LPVOID);
 
 BOOL WINAPI
@@ -73,6 +95,30 @@
 {
   _PVFV *pfunc;
 
+#ifndef _WIN64
+  if (_winmajor < 4)
+  {
+    __mingw_usemthread_dll = 1;
+    __mingw_mthread_hdll = LoadLibrary (MINGWM10_DLL);
+    if (__mingw_mthread_hdll != NULL)
+    {
+      __mingw_gMTRemoveKeyDtor = (fMTRemoveKeyDtor) GetProcAddress (__mingw_mthread_hdll, "__mingwthr_remove_key_dtor");
+      __mingw_gMTKeyDtor = (fMTKeyDtor)  GetProcAddress (__mingw_mthread_hdll, "__mingwthr_key_dtor");
+    }
+    if (__mingw_mthread_hdll == NULL || !__mingw_gMTRemoveKeyDtor || !__mingw_gMTKeyDtor)
+      {
+	__mingw_gMTKeyDtor = NULL;
+	__mingw_gMTRemoveKeyDtor = NULL;
+	if (__mingw_mthread_hdll)
+	  FreeLibrary (__mingw_mthread_hdll);
+	__mingw_mthread_hdll = NULL;
+	_CRT_MT = 0;
+	return TRUE;
+      }
+    _CRT_MT = 1;
+    return TRUE;
+  }
+#endif
   /* We don't let us trick here.  */
   if (_CRT_MT != 2)
    _CRT_MT = 2;

Added: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/tlsthrd.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/tlsthrd.c?rev=46537&view=auto
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/tlsthrd.c (added)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/tlsthrd.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -1,0 +1,148 @@
+/**
+ * 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.PD within this package.
+ *
+ * Written by Kai Tietz  <kai.tietz at onevision.com>
+ *
+ * This file is used by if gcc is built with --enable-threads=win32.
+ *
+ * Based on version created by Mumit Khan  <khan at nanotech.wisc.edu>
+ *
+ */
+
+#ifndef WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN
+#endif
+#include <windows.h>
+#include <stdlib.h>
+
+WINBOOL __mingw_TLScallback (HANDLE hDllHandle, DWORD reason, LPVOID reserved);
+int ___w64_mingwthr_remove_key_dtor (DWORD key);
+int ___w64_mingwthr_add_key_dtor (DWORD key, void (*dtor)(void *));
+
+/* To protect the thread/key association data structure modifications. */
+static CRITICAL_SECTION __mingwthr_cs;
+static volatile int __mingwthr_cs_init = 0;
+
+typedef struct __mingwthr_key __mingwthr_key_t;
+
+/* The list of threads active with key/dtor pairs. */
+struct __mingwthr_key {
+  DWORD key;
+  void (*dtor)(void *);
+  __mingwthr_key_t volatile *next;
+};
+
+
+static __mingwthr_key_t volatile *key_dtor_list;
+
+int
+___w64_mingwthr_add_key_dtor (DWORD key, void (*dtor)(void *))
+{
+  __mingwthr_key_t *new_key;
+
+  if (__mingwthr_cs_init == 0)
+    return 0;
+  new_key = (__mingwthr_key_t *) calloc (1, sizeof (__mingwthr_key_t));
+  if (new_key == NULL)
+    return -1;
+
+  new_key->key = key;
+  new_key->dtor = dtor;
+
+  EnterCriticalSection (&__mingwthr_cs);
+
+  new_key->next = key_dtor_list;
+  key_dtor_list = new_key;
+
+  LeaveCriticalSection (&__mingwthr_cs);
+  return 0;
+}
+
+int
+___w64_mingwthr_remove_key_dtor (DWORD key)
+{
+  __mingwthr_key_t volatile *prev_key;
+  __mingwthr_key_t volatile *cur_key;
+
+  if (__mingwthr_cs_init == 0)
+    return 0;
+
+  EnterCriticalSection (&__mingwthr_cs);
+
+  prev_key = NULL;
+  cur_key = key_dtor_list;
+
+  while (cur_key != NULL)
+    {
+      if ( cur_key->key == key)
+        {
+          if (prev_key == NULL)
+            key_dtor_list = cur_key->next;
+          else
+            prev_key->next = cur_key->next;
+
+          free ((void*)cur_key);
+          break;
+        }
+      prev_key = cur_key;
+      cur_key = cur_key->next;
+    }
+
+  LeaveCriticalSection (&__mingwthr_cs);
+  return 0;
+}
+
+static void
+__mingwthr_run_key_dtors (void)
+{
+  __mingwthr_key_t volatile *keyp;
+
+  if (__mingwthr_cs_init == 0)
+    return;
+  EnterCriticalSection (&__mingwthr_cs);
+
+  for (keyp = key_dtor_list; keyp; )
+    {
+      LPVOID value = TlsGetValue (keyp->key);
+      if (GetLastError () == ERROR_SUCCESS)
+        {
+          if (value)
+            (*keyp->dtor) (value);
+        }
+      keyp = keyp->next;
+    }
+
+  LeaveCriticalSection (&__mingwthr_cs);
+}
+
+WINBOOL
+__mingw_TLScallback (HANDLE hDllHandle __attribute__ ((__unused__)),
+		     DWORD reason,
+		     LPVOID reserved __attribute__ ((__unused__)))
+{
+  switch (reason)
+    {
+    case DLL_PROCESS_ATTACH:
+      if (__mingwthr_cs_init == 0)
+        InitializeCriticalSection (&__mingwthr_cs);
+      __mingwthr_cs_init = 1;
+      break;
+    case DLL_PROCESS_DETACH:
+      __mingwthr_run_key_dtors();
+      if (__mingwthr_cs_init == 1)
+        {
+          __mingwthr_cs_init = 0;
+          DeleteCriticalSection (&__mingwthr_cs);
+        }
+      break;
+    case DLL_THREAD_ATTACH:
+      break;
+    case DLL_THREAD_DETACH:
+      __mingwthr_run_key_dtors();
+      break;
+    }
+  return TRUE;
+}
+

Propchange: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/tlsthrd.c
------------------------------------------------------------------------------
    svn:eol-style = native

Added: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/toascii.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/toascii.c?rev=46537&view=auto
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/toascii.c (added)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/toascii.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -1,0 +1,17 @@
+/**
+ * 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.PD within this package.
+ */
+
+#include <ctype.h>
+
+#undef toascii
+
+int toascii (int);
+
+int
+toascii (int c)
+{
+	return __toascii(c);
+}

Propchange: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/toascii.c
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/txtmode.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/txtmode.c?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/txtmode.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/txtmode.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -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.
  */
 
 #include <fcntl.h>

Added: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/ucrtexe.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/ucrtexe.c?rev=46537&view=auto
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/ucrtexe.c (added)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/ucrtexe.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -1,0 +1,14 @@
+/**
+ * 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.PD within this package.
+ */
+
+#ifndef UNICODE
+#define UNICODE
+#endif
+
+#define WPRFLAG 1
+
+#include "crtexe.c"
+

Propchange: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/ucrtexe.c
------------------------------------------------------------------------------
    svn:eol-style = native

Added: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/udll_argv.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/udll_argv.c?rev=46537&view=auto
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/udll_argv.c (added)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/udll_argv.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -1,0 +1,14 @@
+/**
+ * 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.PD within this package.
+ */
+
+#ifndef UNICODE
+#define UNICODE
+#endif
+
+#define WPRFLAG 1
+
+#include "dll_argv.c"
+

Propchange: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/udll_argv.c
------------------------------------------------------------------------------
    svn:eol-style = native

Added: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/udllargc.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/udllargc.c?rev=46537&view=auto
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/udllargc.c (added)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/udllargc.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -1,0 +1,14 @@
+/**
+ * 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.PD within this package.
+ */
+
+#ifndef UNICODE
+#define UNICODE
+#endif
+
+#define WPRFLAG 1
+
+#include "dllargv.c"
+

Propchange: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/udllargc.c
------------------------------------------------------------------------------
    svn:eol-style = native

Added: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/wcscmpi.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/wcscmpi.c?rev=46537&view=auto
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/wcscmpi.c (added)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/wcscmpi.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -1,0 +1,17 @@
+/**
+ * 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.PD within this package.
+ */
+
+#define __CRT__NO_INLINE
+#include <string.h>
+
+#undef wcscmpi
+int wcscmpi (const wchar_t *, const wchar_t *);
+
+int
+wcscmpi (const wchar_t * ws1,const wchar_t * ws2)
+{
+  return _wcsicmp (ws1,ws2);
+}

Propchange: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/wcscmpi.c
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/wildcard.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/wildcard.c?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/wildcard.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/wildcard.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -1,19 +1,33 @@
 /**
  * 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.
  */
 
 /* _dowildcard is an int that controls the globbing of the command line.
  * If _dowildcard is non-zero, the command line will be globbed:  *.*
  * will be expanded to be all files in the startup directory.
+ *
  * In the mingw-w64 library the _dowildcard variable is defined as being
  * 0, therefore command line globbing is DISABLED by default. To turn it
  * on and to leave wildcard command line processing MS's globbing code,
  * include a line in one of your source modules defining _dowildcard and
  * setting it to -1, like so:
  * int _dowildcard = -1;
+ *
+ * Alternatively, the mingw-w64 library can be configured using the
+ * --enable-wildcard option and compiled thusly upon which the resulting
+ * library will have _dowildcard as -1 and command line globbing will be
+ * enabled by default.
  */
 
-int _dowildcard = 0;
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
 
+#ifndef __ENABLE_GLOBBING
+#define __ENABLE_GLOBBING 0 /* -1 */
+#endif
+
+int _dowildcard = __ENABLE_GLOBBING;
+

Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/xncommod.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/xncommod.c?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/xncommod.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/xncommod.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -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.
  */
 
 int _commode = 0;

Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/xthdloc.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/xthdloc.c?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/xthdloc.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/xthdloc.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -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.
  */
 
 int __globallocalestatus = ~0x1;

Modified: branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/xtxtmode.c
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/xtxtmode.c?rev=46537&r1=46536&r2=46537&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/xtxtmode.c [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/lib/3rdparty/mingw/xtxtmode.c [iso-8859-1] Mon Mar 29 01:27:01 2010
@@ -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.
  */
 
 int _fmode = 0;




More information about the Ros-diffs mailing list