libwine:
authorSamuel Serapion <samuel.serapion@gmail.com>
Thu, 24 Jul 2008 14:32:35 +0000 (14:32 +0000)
committerSamuel Serapion <samuel.serapion@gmail.com>
Thu, 24 Jul 2008 14:32:35 +0000 (14:32 +0000)
-use InterlockedExchangeAdd instead of interlocked_xchg_add
libxml2:
-WINSOCKETAPI already defined in config.h no need to redefine
mingw_base:
-rework _fmode refernces to allow ros64 programs to work on win64.
-temporarily hack _wenviron to allow programs to work on win64.
-aling stack to 16bytes
oskit:
-remove inline asm per suggestion by arty

svn path=/branches/ros-amd64-bringup/; revision=34745

reactos/lib/3rdparty/3rdparty.rbuild
reactos/lib/3rdparty/bzip2/bzip2.rbuild
reactos/lib/3rdparty/libwine/debug.c
reactos/lib/3rdparty/libxml2/libxml2.rbuild
reactos/lib/3rdparty/mingw/crt1.c
reactos/lib/3rdparty/mingw/wcrt1.c
reactos/lib/drivers/directory.rbuild
reactos/lib/drivers/oskittcp/include/freebsd/src/sys/machine/endian.h

index d5a8055..75bb1d1 100644 (file)
@@ -4,30 +4,24 @@
        <directory name="adns">
                <xi:include href="adns/adns.rbuild" />
        </directory>
-<!--
        <directory name="bzip2">
                <xi:include href="bzip2/bzip2.rbuild" />
        </directory>
--->
        <directory name="expat">
                <xi:include href="expat/expat.rbuild" />
        </directory>
        <directory name="icu4ros">
                <xi:include href="icu4ros/icu4ros.rbuild" />
        </directory>
-<!--
        <directory name="libwine">
                <xi:include href="libwine/libwine.rbuild" />
        </directory>
--->
        <directory name="libxml2">
                <xi:include href="libxml2/libxml2.rbuild" />
        </directory>
-<!--
        <directory name="mingw">
                <xi:include href="mingw/mingw.rbuild" />
        </directory>
--->
        <directory name="zlib">
                <xi:include href="zlib/zlib.rbuild" />
        </directory>
index 3437902..e5e172c 100644 (file)
@@ -5,7 +5,6 @@
        <define name="BZ_NO_STDIO" />
        <define name="BZ_DECOMPRESS_ONLY" />
        <library>ntoskrnl</library>
-       <library>hal</library>
        <file>bzlib.c</file>
        <file>randtable.c</file>
        <file>crctable.c</file>
index 4dff5ea..b8e8c9e 100644 (file)
@@ -256,7 +256,7 @@ static char *get_temp_buffer( size_t size )
     char *ret;
     int idx;
 
-    idx = interlocked_xchg_add( &pos, 1 ) % (sizeof(list)/sizeof(list[0]));
+    idx = InterlockedExchangeAdd( &pos, 1 ) % (sizeof(list)/sizeof(list[0]));
     if ((ret = realloc( list[idx], size ))) list[idx] = ret;
     return ret;
 }
index 60ba9d4..327c3e6 100644 (file)
@@ -7,7 +7,6 @@
        <define name="_MBCS" />
        <define name="HAVE_WIN32_THREADS" />
        <define name="_REENTRANT" />
-       <define name="_WINSOCKAPI_" />
        <define name="LIBXML_STATIC" />
        <include base="libxml2">include</include>
        <include base="libxml2">.</include>
index a4fb015..dec1333 100644 (file)
@@ -47,14 +47,6 @@ __MINGW_IMPORT
 void __set_app_type(int);
 #endif /* __MSVCRT__ */
 
-/*  Global _fmode for this .exe, not the one in msvcrt.dll,
-    The default is set in txtmode.o in libmingw32.a */
-/* Override the dllimport'd declarations in stdlib.h */
-#undef _fmode
-extern int _fmode;
-#ifdef __MSVCRT__
-extern int* __p__fmode(void); /* To access the dll _fmode */
-#endif
 
 /*
  * Setup the default file handles to have the _CRT_fmode mode, as well as
@@ -68,7 +60,7 @@ _mingw32_init_fmode (void)
   /* Don't set the std file mode if the user hasn't set any value for it. */
   if (_CRT_fmode)
     {
-      _fmode = _CRT_fmode;
+      *_imp___fmode = _CRT_fmode;
 
       /*
        * This overrides the default file mode settings for stdin,
@@ -93,7 +85,7 @@ _mingw32_init_fmode (void)
 
     /*  Now sync  the dll _fmode to the  one for this .exe.  */
 #ifdef __MSVCRT__
-    *__p__fmode() = _fmode;
+    *_imp___fmode = _fmode;
 #else
     *_imp___fmode_dll = _fmode;
 #endif
@@ -224,6 +216,9 @@ __mingw_CRTStartup (void)
   /* Align the stack to 16 bytes for the sake of SSE ops in main
      or in functions inlined into main.  */
   asm  __volatile__  ("andl $-16, %%esp" : : : "%esp");
+#elif defined(__x86_64__)
+  /* Align the stack to 16 bytes */
+  asm  __volatile__  ("andq $-16, %%rsp" : : : "%rsp");
 #elif defined(__mips__)
   /* Align the stack to 16 bytes */
   asm  __volatile__  ("andi %sp,%sp,-16" : : : "%sp");
index df1cec8..28e933b 100644 (file)
@@ -45,14 +45,6 @@ extern int wmain (int, wchar_t **, wchar_t **);
 __MINGW_IMPORT void __set_app_type(int);
 #endif /* __MSVCRT__ */
 
-/*  Global _fmode for this .exe, not the one in msvcrt.dll,
-    The default is set in txtmode.o in libmingw32.a */
-/* Override the dllimport'd declarations in stdlib.h */
-#undef _fmode
-extern int _fmode;
-#ifdef __MSVCRT__
-extern int* __p__fmode(void); /* To access the dll _fmode */
-#endif
 
 /*
  * Setup the default file handles to have the _CRT_fmode mode, as well as
@@ -66,7 +58,7 @@ _mingw32_init_fmode (void)
   /* Don't set the std file mode if the user hasn't set any value for it. */
   if (_CRT_fmode)
     {
-      _fmode = _CRT_fmode;
+      *_imp___fmode = _CRT_fmode;
 
       /*
        * This overrides the default file mode settings for stdin,
@@ -91,7 +83,7 @@ _mingw32_init_fmode (void)
 
     /*  Now sync  the dll _fmode to the  one for this .exe.  */
 #ifdef __MSVCRT__
-    *__p__fmode() = _fmode;
+    *_imp___fmode = _fmode;
 #else
     *_imp___fmode_dll = _fmode;
 #endif
@@ -222,6 +214,9 @@ __mingw_wCRTStartup (void)
   /* Align the stack to 16 bytes for the sake of SSE ops in main
      or in functions inlined into main.  */
   asm  __volatile__  ("andl $-16, %%esp" : : : "%esp");
+#elif defined(__x86_64__)
+  /* Align the stack to 16 bytes */
+  asm  __volatile__  ("andq $-16, %%rsp" : : : "%rsp");
 #elif defined(__mips__)
   /* Align the stack to 16 bytes */
   asm  __volatile__  ("andi %sp,%sp,-16" : : : "%sp");
@@ -238,7 +233,7 @@ __mingw_wCRTStartup (void)
    * that one calls WinMain. See main.c in the 'lib' dir
    * for more details.
    */
-  nRet = wmain (_argc, _wargv, _wenviron);
+  nRet = wmain (_argc, _wargv, NULL);
 
   /*
    * Perform exit processing for the C library. This means
index c6a2b46..de283ec 100644 (file)
@@ -4,14 +4,12 @@
        <directory name="csq">
                <xi:include href="csq/csq.rbuild" />
        </directory>
-<!--
        <directory name="ip">
                <xi:include href="ip/ip.rbuild" />
        </directory>
        <directory name="oskittcp">
                <xi:include href="oskittcp/oskittcp.rbuild" />
        </directory>
--->
        <directory name="chew">
                <xi:include href="chew/chew.rbuild" />
        </directory>
index bf687d2..1912a47 100644 (file)
@@ -56,7 +56,6 @@
 #include <sys/cdefs.h>
 #endif
 
-#ifdef _MSC_VER
 static inline unsigned long __byte_swap_long ( unsigned long i )
 {
        char dst[4];
@@ -76,41 +75,6 @@ static inline unsigned short __byte_swap_word ( unsigned short i )
        dst[1] = src[0];
        return *(unsigned short*)&dst[0];
 }
-#else/*_MSC_VER*/
-#define __word_swap_long(x) \
-({ register u_long __X = (x); \
-   __asm ("rorl $16, %1" \
-       : "=r" (__X) \
-       : "0" (__X)); \
-   __X; })
-#if __GNUC__ >= 2
-#define __byte_swap_long(x) \
-__extension__ ({ register u_long __X = (x); \
-   __asm ("xchgb %h1, %b1\n\trorl $16, %1\n\txchgb %h1, %b1" \
-       : "=q" (__X) \
-       : "0" (__X)); \
-   __X; })
-#define __byte_swap_word(x) \
-__extension__ ({ register u_short __X = (x); \
-   __asm ("xchgb %h1, %b1" \
-       : "=q" (__X) \
-       : "0" (__X)); \
-   __X; })
-#else /* __GNUC__ >= 2 */
-#define __byte_swap_long(x) \
-({ register u_long __X = (x); \
-   __asm ("rorw $8, %w1\n\trorl $16, %1\n\trorw $8, %w1" \
-       : "=r" (__X) \
-       : "0" (__X)); \
-   __X; })
-#define __byte_swap_word(x) \
-({ register u_short __X = (x); \
-   __asm ("rorw $8, %w1" \
-       : "=r" (__X) \
-       : "0" (__X)); \
-   __X; })
-#endif /* __GNUC__ >= 2 */
-#endif /* _MSC_VER */
 
 /*
  * Macros for network/external number representation conversion.