Merge from amd64 branch:
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Tue, 30 Mar 2010 13:30:36 +0000 (13:30 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Tue, 30 Mar 2010 13:30:36 +0000 (13:30 +0000)
46478
[CRT]
- define _CRTBLD
- rename float_t/double_t/long_double_t to float_s/double_s/long_double_s to avoid name conflicts

46511
[FREELDR]
snprintf -> _snprintf

46534
[CRT]
- Set crt="static" in freeldr, rtl, bmfs, ftfd, rtl, mini_hal
- define "CRTDLL" in ntdll, crtdll, msvcrt, msvcrt20, msvcrt40

46535
[CRT HEADERS]
- add _mingw_mac.h from ming-w64 and include it into _mingw.h
- Update _CRTIMP definition
- Fix definition of _wctype
- onexit is not _CRTIMP

46537
[MINGW]
Update mingw library to mingw-w64 trunk (mingw-w64-src_20100325)

46538
Apply MSVC compilation fix.

46539
[MINGW]
Apply MSVC compilation fixes

svn path=/trunk/; revision=46597

16 files changed:
1  2  3 
reactos/boot/freeldr/freeldr/windows/winldr.c
reactos/dll/ntdll/ntdll.rbuild
reactos/dll/win32/msvcrt/msvcrt.rbuild
reactos/hal/halx86/hal_generic.rbuild
reactos/include/crt/_mingw.h
reactos/include/reactos/mingw-w64/internal.h
reactos/include/reactos/mingw-w64/oscalls.h
reactos/include/reactos/mingw-w64/reactos.diff
reactos/include/reactos/mingw-w64/sect_attribs.h
reactos/lib/3rdparty/mingw/CRT_fp10.c
reactos/lib/3rdparty/mingw/CRT_fp8.c
reactos/lib/3rdparty/mingw/crtexe.c
reactos/lib/3rdparty/mingw/gs_support.c
reactos/lib/3rdparty/mingw/mingw.rbuild
reactos/lib/sdk/crt/crt.rbuild
reactos/lib/sdk/crt/libcntpr.rbuild

@@@@ -261,10 -261,13 -261,13 +261,10 @@@@ WinLdrLoadDeviceDriver(PLOADER_PARAMETE
        }
   
        // It's not loaded, we have to load it
-       snprintf(FullPath, sizeof(FullPath), "%s%wZ", BootPath, FilePath);
+       _snprintf(FullPath, sizeof(FullPath), "%s%wZ", BootPath, FilePath);
        Status = WinLdrLoadImage(FullPath, LoaderBootDriver, &DriverBase);
        if (!Status)
 --     {
 --             DPRINTM(DPRINT_WINDOWS, "WinLdrLoadImage() failed\n");
                return FALSE;
 --     }
   
        // Allocate a DTE for it
        Status = WinLdrAllocateDataTableEntry(LoaderBlock, DllName, DllName, DriverBase, DriverDTE);
Simple merge
                                        <file>systimer.S</file>
                                </directory>
                        </if>
-               </directory>
 --                     <if property="ARCH" value="amd64">
 --                             <directory name="amd64">
 --                                     <file>halinit.c</file>
 --                                     <file>irq.S</file>
 --                                     <file>misc.c</file>
 --                                     <file>apic.c</file>
 --                                     <file>systimer.S</file>
 --                                     <file>usage.c</file>
+                               </directory>
 --                     </if>
 --             </directory>
                <directory name="up">
                        <file>halinit_up.c</file>
                        <file>pic.c</file>
Simple merge
@@@@ -21,8 -21,8 -23,9 +23,9 @@@@ extern "C" 
     typedef void (__cdecl *_PVFV)(void);
     typedef int (__cdecl *_PIFV)(void);
     typedef void (__cdecl *_PVFI)(int);
++ #endif
   
-  #if defined (SPECIAL_CRTEXE) && defined (_DLL)
+  #if defined (SPECIAL_CRTEXE) && (defined (_DLL) || defined (__GNUC__))
     extern int _commode;
   #else
     _CRTIMP extern int _commode;
index 0000000,4120661,4120661..905f7ba
mode 000000,100644,100644..100644
--- /dev/null
@@@@ -1,0 -1,83 -1,83 +1,83 @@@@
 ----- internal.h       (Revision 43956)
+  Index: internal.h
+  ===================================================================
 --@@ -32,6 +32,12 @@
+++--- internal.h       (Revision 46537)
+  +++ internal.h       (Arbeitskopie)
 --@@ -43,6 +49,10 @@
+++@@ -35,6 +35,12 @@
+   #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;
 ----- oscalls.h        (Revision 43956)
+++@@ -46,6 +52,10 @@
+       char pipech2[2];
+     } ioinfo;
+   
+  +#ifdef _MSC_VER
+  +#pragma warning(pop)
+  +#endif
+  +
+   #define IOINFO_ARRAY_ELTS (1 << 5)
+   
+   #define _pioinfo(i) (__pioinfo[(i) >> 5] + ((i) & (IOINFO_ARRAY_ELTS - 1)))
+  Index: oscalls.h
+  ===================================================================
 ----- sect_attribs.h   (Revision 43956)
+++--- oscalls.h        (Revision 46537)
+  +++ oscalls.h        (Arbeitskopie)
+  @@ -30,6 +30,11 @@
+   #endif
+   #endif
+   
+  +#ifdef _MSC_VER
+  +#pragma warning(push)
+  +#pragma warning(disable:4214)
+  +#endif
+  +
+   typedef struct _FTIME
+   {
+     unsigned short twosecs : 5;
+  @@ -46,6 +51,10 @@
+     unsigned short year : 7;
+   } FDATE;
+   
+  +#ifdef _MSC_VER
+  +#pragma warning(pop)
+  +#endif
+  +
+   typedef FDATE *PFDATE;
+   
+   #endif
+  Index: sect_attribs.h
+  ===================================================================
+++--- sect_attribs.h   (Revision 46537)
+  +++ sect_attribs.h   (Arbeitskopie)
+  @@ -10,7 +10,7 @@
+   #define _ATTRIBUTES shared
+   #endif
+   
+  -#if 0
+  +#if defined(_MSC_VER)
+   /* Reference list of existing section for msvcrt.  */
+   #pragma section(".CRTMP$XCA",long,_ATTRIBUTES)
+   #pragma section(".CRTMP$XCZ",long,_ATTRIBUTES)
+  @@ -55,6 +55,14 @@
+   #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
   /**
    * 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)
  -  { __asm__ ("fninit" ) ;}
  +{ 
  +#ifdef __GNUC__
  +    __asm__ ("fninit" );
  +#else
  +    __asm fninit;
  +#endif
  +}
   
  +#ifdef __GNUC__
   void __attribute__ ((alias ("_fpreset"))) fpreset(void);
  +#else
  +void fpreset(void) { _fpreset(); }
  +#endif
   /**
    * 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.
    */
   
-  extern void (*_imp___fpreset)(void) ;
+  #include <_mingw.h>
+  
+  extern void (* __MINGW_IMP_SYMBOL(_fpreset))(void);
+  void _fpreset (void);
+  
   void _fpreset (void)
-  { (*_imp___fpreset)(); }
+  {
+    (* __MINGW_IMP_SYMBOL(_fpreset))();
+  }
   
  +#ifdef __GNUC__
   void __attribute__ ((alias ("_fpreset"))) fpreset(void);
  +#else
  +void fpreset(void) { _fpreset(); }
  +#endif
   #include <tchar.h>
   #include <sect_attribs.h>
   #include <locale.h>
  +#include <intrin.h>
   
   #ifndef __winitenv
-  extern wchar_t ***_imp____winitenv;
-  #define __winitenv (*_imp____winitenv)
+  extern wchar_t *** __MINGW_IMP_SYMBOL(__winitenv);
+  #define __winitenv (* __MINGW_IMP_SYMBOL(__winitenv))
   #endif
   
   #ifndef __initenv
-  extern char ***_imp____initenv;
-  #define __initenv (*_imp____initenv)
+  extern char *** __MINGW_IMP_SYMBOL(__initenv);
+  #define __initenv (* __MINGW_IMP_SYMBOL(__initenv))
   #endif
   
-  #define __ImageBase _image_base__
 + /* 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(' ')
   #define DQUOTECHAR _T('\"')
@@@@ -48,15 -43,15 -47,11 +48,15 @@@@ extern int * __MINGW_IMP_SYMBOL(_commod
   
   #undef _fmode
   extern int _fmode;
-  extern int *_imp___commode;
-  #define _commode (*_imp___commode)
+  extern int * __MINGW_IMP_SYMBOL(_commode);
+  #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 *);
   
@@@@ -172,9 -179,9 -180,9 +185,9 @@@@ __tmainCRTStartup (void
   {
     _TCHAR *lpszCommandLine = NULL;
     STARTUPINFO StartupInfo;
--   BOOL inDoubleQuote = FALSE;
++   WINBOOL inDoubleQuote = FALSE;
     memset (&StartupInfo, 0, sizeof (STARTUPINFO));
-  
+    
     if (mingw_app_type)
       GetStartupInfo (&StartupInfo);
     {
   <group>
   <module name="mingw_common" type="staticlibrary" isstartuplib="true" crt="dll">
        <define name="_CRTBLD" />
 -      <importlibrary definition="moldname-msvcrt.def" dllname="msvcrt.dll" />
 + 
 +      <!-- 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">
---             <library>kernel32</library>
 --     </if>
+++     <library>kernel32</library>
        <file>_newmode.c</file>
        <file>atonexit.c</file>
+       <file>binmode.c</file>
        <file>charmax.c</file>
        <file>cinitexe.c</file>
        <file>CRT_fp10.c</file>
        <file>CRT_fp8.c</file>
+       <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>
        <file>xthdloc.c</file>
        <define name="_MSVCRT_LIB_" />
        <define name="_MSVCRT_" />
        <define name="_MT" />
  -     <define name="__CRT__NO_INLINE" />
+       <define name="_CRTBLD" />
        <directory name="conio">
                <file>cgets.c</file>
                <file>cprintf.c</file>
@@@@ -7,6 -7,7 -7,8 +7,7 @@@@
        <define name="_NTSYSTEM_" />
        <define name="_NTDLLBUILD_" />
        <define name="_LIBCNT_" />
  -     <define name="__CRT__NO_INLINE" />
+       <define name="_CRTBLD" />
        <if property="ARCH" value="i386">
                <define name="__MINGW_IMPORT">"extern __attribute__ ((dllexport))"</define>
        </if>