[ros-diffs] [hyperion] 41421: modified dll/win32/srclient/srclient_main.c What the hell, Arch Blackmann? <windef.h>, <winbase.h> and <winnls.h> are not meant to be included directly. Include <windows.h> instead modified drivers/video/font/ftfd/rosglue.c Move standard C includes before Windows includes, so the required types are defined beforehand modified include/crt/_mingw.h Re-add Visual C++ support va_list is not a built-in type, it does not belong in _mingw.h Do not include intrin.h (screw you, Arch) Removed definition of _USE_32BIT_TIME_T ("ROS HACK!") modified include/crt/conio.h modified include/crt/stdio.h modified include/crt/wchar.h Pull in va_list from stdarg.h modified include/crt/mingw32/intrin.h modified include/crt/mingw32/intrin_arm.h modified include/crt/mingw32/intrin_x86.h intrin.h defines size_t and uintptr_t The _real_, ultimate magic incantation for inline functions is extern __inline__ __attribute__((__always_inline__, __gnu_inline__)) Fix __addfsbyte, __addfsword added include/crt/msc added include/crt/msc/intrin.h Ported our intrin.h to Visual C++ modified ReactOS-arm.rbuild modified ReactOS-i386.rbuild ROS HACK!s belong in the project definition modified ReactOS-generic.rbuild Compiler-specific include directories

hyperion at svn.reactos.org hyperion at svn.reactos.org
Tue Jun 16 02:24:27 CEST 2009


Author: hyperion
Date: Tue Jun 16 04:24:26 2009
New Revision: 41421

URL: http://svn.reactos.org/svn/reactos?rev=41421&view=rev
Log:
modified   dll/win32/srclient/srclient_main.c
   What the hell, Arch Blackmann? <windef.h>, <winbase.h> and <winnls.h> are not meant to be included directly. Include <windows.h> instead

modified   drivers/video/font/ftfd/rosglue.c
   Move standard C includes before Windows includes, so the required types are defined beforehand 

modified   include/crt/_mingw.h
   Re-add Visual C++ support
   va_list is not a built-in type, it does not belong in _mingw.h
   Do not include intrin.h (screw you, Arch)
   Removed definition of _USE_32BIT_TIME_T ("ROS HACK!")

modified   include/crt/conio.h
modified   include/crt/stdio.h
modified   include/crt/wchar.h
   Pull in va_list from stdarg.h

modified   include/crt/mingw32/intrin.h
modified   include/crt/mingw32/intrin_arm.h
modified   include/crt/mingw32/intrin_x86.h
   intrin.h defines size_t and uintptr_t
   The _real_, ultimate magic incantation for inline functions is extern __inline__ __attribute__((__always_inline__,__gnu_inline__))
   Fix __addfsbyte, __addfsword

added      include/crt/msc
added      include/crt/msc/intrin.h
   Ported our intrin.h to Visual C++

modified   ReactOS-arm.rbuild
modified   ReactOS-i386.rbuild
   ROS HACK!s belong in the project definition

modified   ReactOS-generic.rbuild
   Compiler-specific include directories

Added:
    trunk/reactos/include/crt/msc/   (with props)
    trunk/reactos/include/crt/msc/intrin.h   (with props)
Modified:
    trunk/reactos/ReactOS-arm.rbuild
    trunk/reactos/ReactOS-generic.rbuild
    trunk/reactos/ReactOS-i386.rbuild
    trunk/reactos/dll/win32/srclient/srclient_main.c
    trunk/reactos/drivers/video/font/ftfd/rosglue.c
    trunk/reactos/include/crt/_mingw.h
    trunk/reactos/include/crt/conio.h
    trunk/reactos/include/crt/mingw32/intrin.h
    trunk/reactos/include/crt/mingw32/intrin_arm.h
    trunk/reactos/include/crt/mingw32/intrin_x86.h
    trunk/reactos/include/crt/stdio.h
    trunk/reactos/include/crt/wchar.h

Modified: trunk/reactos/ReactOS-arm.rbuild
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ReactOS-arm.rbuild?rev=41421&r1=41420&r2=41421&view=diff
==============================================================================
--- trunk/reactos/ReactOS-arm.rbuild [iso-8859-1] (original)
+++ trunk/reactos/ReactOS-arm.rbuild [iso-8859-1] Tue Jun 16 04:24:26 2009
@@ -23,7 +23,7 @@
 		<define name="KDBG">1</define>
 		<property name="DBG_OR_KDBG" value="true" />
 	</if>
-	
+
 	<include>.</include>
 	<include>include</include>
 	<include root="intermediate">include</include>
@@ -71,11 +71,11 @@
 	<compilerflag>-fno-strict-aliasing</compilerflag>
 	<linkerflag>--strip-debug</linkerflag>
 	<linkerflag>-static</linkerflag>
-	
+
 	<directory name="media">
 		<directory name="nls">
 			<xi:include href="media/nls/nls.rbuild" />
-		</directory>	
+		</directory>
 	</directory>
 	<directory name="lib">
 		<directory name="drivers">
@@ -180,13 +180,15 @@
 	<directory name="dll">
 		<directory name="ntdll">
 			<xi:include href="dll/ntdll/ntdll.rbuild" />
-		</directory>	
+		</directory>
 	</directory>
 	<directory name="base">
 		<directory name="system">
             <directory name="smss">
                 <xi:include href="base/system/smss/smss.rbuild" />
-            </directory>	
-		</directory>	
+            </directory>
+		</directory>
 	</directory>
+
+	<define name="_USE_32BIT_TIME_T" />
 </project>

Modified: trunk/reactos/ReactOS-generic.rbuild
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ReactOS-generic.rbuild?rev=41421&r1=41420&r2=41421&view=diff
==============================================================================
--- trunk/reactos/ReactOS-generic.rbuild [iso-8859-1] (original)
+++ trunk/reactos/ReactOS-generic.rbuild [iso-8859-1] Tue Jun 16 04:24:26 2009
@@ -67,7 +67,8 @@
 	<include>include/dxsdk</include>
 	<include root="intermediate">include/dxsdk</include>
 	<include>include/crt</include>
-	<include>include/crt/mingw32</include>
+	<include compilerset="gcc">include/crt/mingw32</include>
+	<include compilerset="msc">include/crt/msc</include>
 	<include>include/ddk</include>
 	<include>include/GL</include>
 	<include>include/ndk</include>

Modified: trunk/reactos/ReactOS-i386.rbuild
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ReactOS-i386.rbuild?rev=41421&r1=41420&r2=41421&view=diff
==============================================================================
--- trunk/reactos/ReactOS-i386.rbuild [iso-8859-1] (original)
+++ trunk/reactos/ReactOS-i386.rbuild [iso-8859-1] Tue Jun 16 04:24:26 2009
@@ -79,4 +79,5 @@
 		<linkerflag>-disable-stdcall-fixup</linkerflag>
 	</group>
 
+	<define name="_USE_32BIT_TIME_T" />
 </project>

Modified: trunk/reactos/dll/win32/srclient/srclient_main.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/srclient/srclient_main.c?rev=41421&r1=41420&r2=41421&view=diff
==============================================================================
--- trunk/reactos/dll/win32/srclient/srclient_main.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/srclient/srclient_main.c [iso-8859-1] Tue Jun 16 04:24:26 2009
@@ -16,9 +16,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include <windef.h>
-#include <winbase.h>
-#include <winnls.h>
+#include <windows.h>
 #include <srrestoreptapi.h>
 
 #define NDEBUG

Modified: trunk/reactos/drivers/video/font/ftfd/rosglue.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/video/font/ftfd/rosglue.c?rev=41421&r1=41420&r2=41421&view=diff
==============================================================================
--- trunk/reactos/drivers/video/font/ftfd/rosglue.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/video/font/ftfd/rosglue.c [iso-8859-1] Tue Jun 16 04:24:26 2009
@@ -8,11 +8,11 @@
  * NOTES:
  */
 
+#include <stdarg.h>
+#include <stdio.h>
 #include <windef.h>
 #include <wingdi.h>
 #include <winddi.h>
-#include <stdarg.h>
-#include <stdio.h>
 
 #define NDEBUG
 #include <debug.h>

Modified: trunk/reactos/include/crt/_mingw.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/_mingw.h?rev=41421&r1=41420&r2=41421&view=diff
==============================================================================
--- trunk/reactos/include/crt/_mingw.h [iso-8859-1] (original)
+++ trunk/reactos/include/crt/_mingw.h [iso-8859-1] Tue Jun 16 04:24:26 2009
@@ -8,13 +8,6 @@
 #define _INC_MINGW
 
 #define _INTEGRAL_MAX_BITS 64
-
-// ROS HACK!
-#ifndef _WIN64
- #ifndef _USE_32BIT_TIME_T
-  #define _USE_32BIT_TIME_T
- #endif
-#endif
 
 #ifndef MINGW64
 #define MINGW64
@@ -48,15 +41,19 @@
 #define __MINGW_GNUC_PREREQ(major, minor)  0
 #endif
 
-#if !defined (_MSC_VER)
-#define __MINGW_MSC_PREREQ(major, minor)  0
+#if defined (_MSC_VER)
+#define __MINGW_MSC_PREREQ(major, minor) ((major * 100 + minor * 10) >= _MSC_VER)
+#else
+#define __MINGW_MSC_PREREQ(major, minor) 0
 #endif
 
 #define USE___UUIDOF	0
 
 #ifdef __cplusplus
 # define __CRT_INLINE inline
-#else
+#elif defined(_MSC_VER)
+# define __CRT_INLINE __inline
+#elif defined(__GNUC__)
 # if ( __MINGW_GNUC_PREREQ(4, 3)  &&  __STDC_VERSION__ >= 199901L)
 #  define __CRT_INLINE extern inline __attribute__((__always_inline__,__gnu_inline__))
 # else
@@ -79,8 +76,10 @@
 #else
 # ifdef __GNUC__
 #  define __unaligned __attribute((packed))
+# elif defined(_MSC_VER) && !defined(_M_IA64) && !defined(_M_AMD64)
+#  define __unaligned
 # else
-#  define __UNUSED_PARAM(x) x
+#  define __unaligned
 # endif
 #endif
 
@@ -98,6 +97,9 @@
 #if __MINGW_GNUC_PREREQ (3, 0)
 #define __MINGW_ATTRIB_MALLOC __attribute__ ((__malloc__))
 #define __MINGW_ATTRIB_PURE __attribute__ ((__pure__))
+#elif __MINGW_MSC_PREREQ(14, 0)
+#define __MINGW_ATTRIB_MALLOC __declspec(noalias) __declspec(restrict)
+#define __MINGW_ATTRIB_PURE
 #else
 #define __MINGW_ATTRIB_MALLOC
 #define __MINGW_ATTRIB_PURE
@@ -119,7 +121,7 @@
 #else
 #define __MINGW_ATTRIB_DEPRECATED
 #endif
- 
+
 #if  __MINGW_GNUC_PREREQ (3, 3)
 #define __MINGW_NOTHROW __attribute__ ((__nothrow__))
 #elif __MINGW_MSC_PREREQ(12, 0) && defined (__cplusplus)
@@ -172,33 +174,11 @@
 #define USE_MINGW_SETJMP_TWO_ARGS
 #endif
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef __GNUC_VA_LIST
-#define __GNUC_VA_LIST
-  typedef __builtin_va_list __gnuc_va_list;
-#endif
-
-#ifndef _VA_LIST_DEFINED
-#define _VA_LIST_DEFINED
-  typedef __gnuc_va_list va_list;
-#endif
-
 /* Diable deprecation for now! */
 #define _CRT_SECURE_NO_DEPRECATE
 #define _CRT_SECURE_NO_DEPRECATE_CORE
 #ifdef __WINESRC__
 #define _CRT_NONSTDC_NO_DEPRECATE
-#endif
-
-#if (defined(_MSC_VER) && __STDC__)// || !defined(__WINESRC__)
-#define NO_OLDNAMES
-#endif
-
-#ifdef __cplusplus
-}
 #endif
 
 #define __crt_typefix(ctype)
@@ -207,26 +187,5 @@
 #define _CRT_UNUSED(x) (void)x
 #endif
 
-/* These are here for intrin.h */
-#ifndef _SIZE_T_DEFINED
-#define _SIZE_T_DEFINED
-#ifdef _WIN64
-  typedef unsigned __int64 size_t;
-#else
-  typedef unsigned int size_t;
-#endif
-#endif
-
-#ifndef _UINTPTR_T_DEFINED
-#define _UINTPTR_T_DEFINED
-#ifdef _WIN64
-  typedef unsigned __int64 uintptr_t;
-#else
-  typedef unsigned int uintptr_t;
-#endif
-#endif
-
-#include <mingw32/intrin.h>
-
 #endif /* !_INC_MINGW */
 

Modified: trunk/reactos/include/crt/conio.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/conio.h?rev=41421&r1=41420&r2=41421&view=diff
==============================================================================
--- trunk/reactos/include/crt/conio.h [iso-8859-1] (original)
+++ trunk/reactos/include/crt/conio.h [iso-8859-1] Tue Jun 16 04:24:26 2009
@@ -7,6 +7,9 @@
 #define _INC_CONIO
 
 #include <crtdefs.h>
+
+#define __need___va_list
+#include <stdarg.h>
 
 #ifdef __cplusplus
 extern "C" {

Modified: trunk/reactos/include/crt/mingw32/intrin.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/mingw32/intrin.h?rev=41421&r1=41420&r2=41421&view=diff
==============================================================================
--- trunk/reactos/include/crt/mingw32/intrin.h [iso-8859-1] (original)
+++ trunk/reactos/include/crt/mingw32/intrin.h [iso-8859-1] Tue Jun 16 04:24:26 2009
@@ -30,8 +30,24 @@
 
 #ifndef RC_INVOKED
 
-#ifndef __GNUC__
-#error Unsupported compiler
+#define __INTRIN_INLINE extern __inline__ __attribute__((__always_inline__,__gnu_inline__))
+
+#ifndef _SIZE_T_DEFINED
+#define _SIZE_T_DEFINED
+#ifdef _WIN64
+  typedef unsigned __int64 size_t;
+#else
+  typedef unsigned int size_t;
+#endif
+#endif
+
+#ifndef _UINTPTR_T_DEFINED
+#define _UINTPTR_T_DEFINED
+#ifdef _WIN64
+  typedef unsigned __int64 uintptr_t;
+#else
+  typedef unsigned int uintptr_t;
+#endif
 #endif
 
 /*

Modified: trunk/reactos/include/crt/mingw32/intrin_arm.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/mingw32/intrin_arm.h?rev=41421&r1=41420&r2=41421&view=diff
==============================================================================
--- trunk/reactos/include/crt/mingw32/intrin_arm.h [iso-8859-1] (original)
+++ trunk/reactos/include/crt/mingw32/intrin_arm.h [iso-8859-1] Tue Jun 16 04:24:26 2009
@@ -34,10 +34,10 @@
 
 #define _ReadWriteBarrier() __sync_synchronize()
 
-static __inline__ __attribute__((always_inline)) long _InterlockedCompareExchange(volatile long * const dest, const long exch, const long comp)
+__INTRIN_INLINE long _InterlockedCompareExchange(volatile long * const dest, const long exch, const long comp)
 {
 	long a, b;
-    
+
 	__asm__ __volatile__ (    "0:\n\t"
                           "ldr %1, [%2]\n\t"
                           "cmp %1, %4\n\t"
@@ -50,11 +50,11 @@
                           : "=&r" (a), "=&r" (b)
                           : "r" (dest), "r" (exch), "r" (comp)
                           : "cc", "memory");
-    
+
 	return a;
 }
 
-static __inline__ __attribute__((always_inline)) long long _InterlockedCompareExchange64(volatile long long * const dest, const long long exch, const long long comp)
+__INTRIN_INLINE long long _InterlockedCompareExchange64(volatile long long * const dest, const long long exch, const long long comp)
 {
     //
     // FIXME
@@ -65,16 +65,16 @@
     return result;
 }
 
-static __inline__ __attribute__((always_inline)) void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand)
+__INTRIN_INLINE void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand)
 {
     return (void*)_InterlockedCompareExchange((volatile long* const)Destination, (const long)Exchange, (const long)Comperand);
 }
 
 
-static __inline__ __attribute__((always_inline)) long _InterlockedExchangeAdd(volatile long * const dest, const long add)
+__INTRIN_INLINE long _InterlockedExchangeAdd(volatile long * const dest, const long add)
 {
 	long a, b, c;
-    
+
 	__asm__ __volatile__ (  "0:\n\t"
                           "ldr %0, [%3]\n\t"
                           "add %1, %0, %4\n\t"
@@ -85,201 +85,201 @@
                           : "=&r" (a), "=&r" (b), "=&r" (c)
                           : "r" (dest), "r" (add)
                           : "cc", "memory");
-    
+
 	return a;
 }
 
-static __inline__ __attribute__((always_inline)) long _InterlockedExchange(volatile long * const dest, const long exch)
+__INTRIN_INLINE long _InterlockedExchange(volatile long * const dest, const long exch)
 {
 	long a;
-    
+
 	__asm__ __volatile__ (  "swp %0, %2, [%1]"
                           : "=&r" (a)
                           : "r" (dest), "r" (exch));
-    
+
 	return a;
 }
 
 
-static __inline__ __attribute__((always_inline)) void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value)
+__INTRIN_INLINE void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value)
 {
     return _InterlockedExchange(Target, Value);
 }
 
-static __inline__ __attribute__((always_inline)) char _InterlockedAnd8(volatile char * const value, const char mask)
+__INTRIN_INLINE char _InterlockedAnd8(volatile char * const value, const char mask)
 {
 	char x;
 	char y;
-    
-	y = *value;
-    
+
+	y = *value;
+
 	do
 	{
 		x = y;
 		y = _InterlockedCompareExchange8(value, x & mask, x);
 	}
 	while(y != x);
-    
-	return y;
-}
-
-static __inline__ __attribute__((always_inline)) short _InterlockedAnd16(volatile short * const value, const short mask)
+
+	return y;
+}
+
+__INTRIN_INLINE short _InterlockedAnd16(volatile short * const value, const short mask)
 {
 	short x;
 	short y;
-    
-	y = *value;
-    
+
+	y = *value;
+
 	do
 	{
 		x = y;
 		y = _InterlockedCompareExchange16(value, x & mask, x);
 	}
 	while(y != x);
-    
-	return y;
-}
-
-static __inline__ __attribute__((always_inline)) long _InterlockedAnd(volatile long * const value, const long mask)
+
+	return y;
+}
+
+__INTRIN_INLINE long _InterlockedAnd(volatile long * const value, const long mask)
 {
 	long x;
 	long y;
-    
-	y = *value;
-    
+
+	y = *value;
+
 	do
 	{
 		x = y;
 		y = _InterlockedCompareExchange(value, x & mask, x);
 	}
 	while(y != x);
-    
-	return y;
-}
-
-static __inline__ __attribute__((always_inline)) char _InterlockedOr8(volatile char * const value, const char mask)
+
+	return y;
+}
+
+__INTRIN_INLINE char _InterlockedOr8(volatile char * const value, const char mask)
 {
 	char x;
 	char y;
-    
-	y = *value;
-    
+
+	y = *value;
+
 	do
 	{
 		x = y;
 		y = _InterlockedCompareExchange8(value, x | mask, x);
 	}
 	while(y != x);
-    
-	return y;
-}
-
-static __inline__ __attribute__((always_inline)) short _InterlockedOr16(volatile short * const value, const short mask)
+
+	return y;
+}
+
+__INTRIN_INLINE short _InterlockedOr16(volatile short * const value, const short mask)
 {
 	short x;
 	short y;
-    
-	y = *value;
-    
+
+	y = *value;
+
 	do
 	{
 		x = y;
 		y = _InterlockedCompareExchange16(value, x | mask, x);
 	}
 	while(y != x);
-    
-	return y;
-}
-
-static __inline__ __attribute__((always_inline)) long _InterlockedOr(volatile long * const value, const long mask)
+
+	return y;
+}
+
+__INTRIN_INLINE long _InterlockedOr(volatile long * const value, const long mask)
 {
 	long x;
 	long y;
-    
-	y = *value;
-    
+
+	y = *value;
+
 	do
 	{
 		x = y;
 		y = _InterlockedCompareExchange(value, x | mask, x);
 	}
 	while(y != x);
-    
-	return y;
-}
-
-static __inline__ __attribute__((always_inline)) char _InterlockedXor8(volatile char * const value, const char mask)
+
+	return y;
+}
+
+__INTRIN_INLINE char _InterlockedXor8(volatile char * const value, const char mask)
 {
 	char x;
 	char y;
-    
-	y = *value;
-    
+
+	y = *value;
+
 	do
 	{
 		x = y;
 		y = _InterlockedCompareExchange8(value, x ^ mask, x);
 	}
 	while(y != x);
-    
-	return y;
-}
-
-static __inline__ __attribute__((always_inline)) short _InterlockedXor16(volatile short * const value, const short mask)
+
+	return y;
+}
+
+__INTRIN_INLINE short _InterlockedXor16(volatile short * const value, const short mask)
 {
 	short x;
 	short y;
-    
-	y = *value;
-    
+
+	y = *value;
+
 	do
 	{
 		x = y;
 		y = _InterlockedCompareExchange16(value, x ^ mask, x);
 	}
 	while(y != x);
-    
-	return y;
-}
-
-static __inline__ __attribute__((always_inline)) long _InterlockedXor(volatile long * const value, const long mask)
+
+	return y;
+}
+
+__INTRIN_INLINE long _InterlockedXor(volatile long * const value, const long mask)
 {
 	long x;
 	long y;
-    
-	y = *value;
-    
+
+	y = *value;
+
 	do
 	{
 		x = y;
 		y = _InterlockedCompareExchange(value, x ^ mask, x);
 	}
 	while(y != x);
-    
-	return y;
-}
-
-static __inline__ __attribute__((always_inline)) long _InterlockedDecrement(volatile long * const lpAddend)
+
+	return y;
+}
+
+__INTRIN_INLINE long _InterlockedDecrement(volatile long * const lpAddend)
 {
 	return _InterlockedExchangeAdd(lpAddend, -1) - 1;
 }
 
-static __inline__ __attribute__((always_inline)) long _InterlockedIncrement(volatile long * const lpAddend)
+__INTRIN_INLINE long _InterlockedIncrement(volatile long * const lpAddend)
 {
 	return _InterlockedExchangeAdd(lpAddend, 1) + 1;
 }
 
-static __inline__ __attribute__((always_inline)) long _InterlockedDecrement16(volatile short * const lpAddend)
+__INTRIN_INLINE long _InterlockedDecrement16(volatile short * const lpAddend)
 {
 	return _InterlockedExchangeAdd16(lpAddend, -1) - 1;
 }
 
-static __inline__ __attribute__((always_inline)) long _InterlockedIncrement16(volatile short * const lpAddend)
+__INTRIN_INLINE long _InterlockedIncrement16(volatile short * const lpAddend)
 {
 	return _InterlockedExchangeAdd16(lpAddend, 1) + 1;
 }
 
-static __inline__ __attribute__((always_inline)) void _disable(void)
+__INTRIN_INLINE void _disable(void)
 {
     __asm__ __volatile__
     (
@@ -289,7 +289,7 @@
     );
 }
 
-static __inline__ __attribute__((always_inline)) void _enable(void)
+__INTRIN_INLINE void _enable(void)
 {
     __asm__ __volatile__
     (
@@ -300,7 +300,7 @@
 }
 
 #ifndef __MSVCRT__
-static __inline__ __attribute__((always_inline)) unsigned long _rotl(const unsigned long value, const unsigned char shift)
+__INTRIN_INLINE unsigned long _rotl(const unsigned long value, const unsigned char shift)
 {
 	return (((value) << ((int)(shift))) | ((value) >> (32 - (int)(shift))));
 }

Modified: trunk/reactos/include/crt/mingw32/intrin_x86.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/mingw32/intrin_x86.h?rev=41421&r1=41420&r2=41421&view=diff
==============================================================================
--- trunk/reactos/include/crt/mingw32/intrin_x86.h [iso-8859-1] (original)
+++ trunk/reactos/include/crt/mingw32/intrin_x86.h [iso-8859-1] Tue Jun 16 04:24:26 2009
@@ -80,7 +80,7 @@
 #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40100
 #define _ReadWriteBarrier() __sync_synchronize()
 #else
-static void __inline__ __attribute__((always_inline)) _MemoryBarrier(void)
+__INTRIN_INLINE void _MemoryBarrier(void)
 {
 	__asm__ __volatile__("" : : : "memory");
 }
@@ -93,27 +93,27 @@
 
 #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40100
 
-static __inline__ __attribute__((always_inline)) char _InterlockedCompareExchange8(volatile char * const Destination, const char Exchange, const char Comperand)
+__INTRIN_INLINE char _InterlockedCompareExchange8(volatile char * const Destination, const char Exchange, const char Comperand)
 {
 	return __sync_val_compare_and_swap(Destination, Comperand, Exchange);
 }
 
-static __inline__ __attribute__((always_inline)) short _InterlockedCompareExchange16(volatile short * const Destination, const short Exchange, const short Comperand)
+__INTRIN_INLINE short _InterlockedCompareExchange16(volatile short * const Destination, const short Exchange, const short Comperand)
 {
 	return __sync_val_compare_and_swap(Destination, Comperand, Exchange);
 }
 
-static __inline__ __attribute__((always_inline)) long _InterlockedCompareExchange(volatile long * const Destination, const long Exchange, const long Comperand)
+__INTRIN_INLINE long _InterlockedCompareExchange(volatile long * const Destination, const long Exchange, const long Comperand)
 {
 	return __sync_val_compare_and_swap(Destination, Comperand, Exchange);
 }
 
-static __inline__ __attribute__((always_inline)) void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand)
+__INTRIN_INLINE void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand)
 {
 	return __sync_val_compare_and_swap(Destination, Comperand, Exchange);
 }
 
-static __inline__ __attribute__((always_inline)) long _InterlockedExchange(volatile long * const Target, const long Value)
+__INTRIN_INLINE long _InterlockedExchange(volatile long * const Target, const long Value)
 {
 	/* NOTE: __sync_lock_test_and_set would be an acquire barrier, so we force a full barrier */
 	__sync_synchronize();
@@ -121,7 +121,7 @@
 }
 
 #if defined(_M_AMD64)
-static __inline__ __attribute__((always_inline)) long long _InterlockedExchange64(volatile long long * const Target, const long long Value)
+__INTRIN_INLINE long long _InterlockedExchange64(volatile long long * const Target, const long long Value)
 {
 	/* NOTE: __sync_lock_test_and_set would be an acquire barrier, so we force a full barrier */
 	__sync_synchronize();
@@ -129,148 +129,148 @@
 }
 #endif
 
-static __inline__ __attribute__((always_inline)) void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value)
+__INTRIN_INLINE void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value)
 {
 	/* NOTE: ditto */
 	__sync_synchronize();
 	return __sync_lock_test_and_set(Target, Value);
 }
 
-static __inline__ __attribute__((always_inline)) long _InterlockedExchangeAdd16(volatile short * const Addend, const short Value)
+__INTRIN_INLINE long _InterlockedExchangeAdd16(volatile short * const Addend, const short Value)
 {
 	return __sync_fetch_and_add(Addend, Value);
 }
 
-static __inline__ __attribute__((always_inline)) long _InterlockedExchangeAdd(volatile long * const Addend, const long Value)
+__INTRIN_INLINE long _InterlockedExchangeAdd(volatile long * const Addend, const long Value)
 {
 	return __sync_fetch_and_add(Addend, Value);
 }
 
 #if defined(_M_AMD64)
-static __inline__ __attribute__((always_inline)) long long _InterlockedExchangeAdd64(volatile long long * const Addend, const long long Value)
+__INTRIN_INLINE long long _InterlockedExchangeAdd64(volatile long long * const Addend, const long long Value)
 {
 	return __sync_fetch_and_add(Addend, Value);
 }
 #endif
 
-static __inline__ __attribute__((always_inline)) char _InterlockedAnd8(volatile char * const value, const char mask)
+__INTRIN_INLINE char _InterlockedAnd8(volatile char * const value, const char mask)
 {
 	return __sync_fetch_and_and(value, mask);
 }
 
-static __inline__ __attribute__((always_inline)) short _InterlockedAnd16(volatile short * const value, const short mask)
+__INTRIN_INLINE short _InterlockedAnd16(volatile short * const value, const short mask)
 {
 	return __sync_fetch_and_and(value, mask);
 }
 
-static __inline__ __attribute__((always_inline)) long _InterlockedAnd(volatile long * const value, const long mask)
+__INTRIN_INLINE long _InterlockedAnd(volatile long * const value, const long mask)
 {
 	return __sync_fetch_and_and(value, mask);
 }
 
 #if defined(_M_AMD64)
-static __inline__ __attribute__((always_inline)) long _InterlockedAnd64(volatile long long * const value, const long long mask)
+__INTRIN_INLINE long _InterlockedAnd64(volatile long long * const value, const long long mask)
 {
 	return __sync_fetch_and_and(value, mask);
 }
 #endif
 
-static __inline__ __attribute__((always_inline)) char _InterlockedOr8(volatile char * const value, const char mask)
+__INTRIN_INLINE char _InterlockedOr8(volatile char * const value, const char mask)
 {
 	return __sync_fetch_and_or(value, mask);
 }
 
-static __inline__ __attribute__((always_inline)) short _InterlockedOr16(volatile short * const value, const short mask)
+__INTRIN_INLINE short _InterlockedOr16(volatile short * const value, const short mask)
 {
 	return __sync_fetch_and_or(value, mask);
 }
 
-static __inline__ __attribute__((always_inline)) long _InterlockedOr(volatile long * const value, const long mask)
+__INTRIN_INLINE long _InterlockedOr(volatile long * const value, const long mask)
 {
 	return __sync_fetch_and_or(value, mask);
 }
 
 #if defined(_M_AMD64)
-static __inline__ __attribute__((always_inline)) long _InterlockedOr64(volatile long long * const value, const long long mask)
+__INTRIN_INLINE long _InterlockedOr64(volatile long long * const value, const long long mask)
 {
 	return __sync_fetch_and_or(value, mask);
 }
 #endif
 
-static __inline__ __attribute__((always_inline)) char _InterlockedXor8(volatile char * const value, const char mask)
+__INTRIN_INLINE char _InterlockedXor8(volatile char * const value, const char mask)
 {
 	return __sync_fetch_and_xor(value, mask);
 }
 
-static __inline__ __attribute__((always_inline)) short _InterlockedXor16(volatile short * const value, const short mask)
+__INTRIN_INLINE short _InterlockedXor16(volatile short * const value, const short mask)
 {
 	return __sync_fetch_and_xor(value, mask);
 }
 
-static __inline__ __attribute__((always_inline)) long _InterlockedXor(volatile long * const value, const long mask)
+__INTRIN_INLINE long _InterlockedXor(volatile long * const value, const long mask)
 {
 	return __sync_fetch_and_xor(value, mask);
 }
 
 #else
 
-static __inline__ __attribute__((always_inline)) char _InterlockedCompareExchange8(volatile char * const Destination, const char Exchange, const char Comperand)
+__INTRIN_INLINE char _InterlockedCompareExchange8(volatile char * const Destination, const char Exchange, const char Comperand)
 {
 	char retval = Comperand;
 	__asm__("lock; cmpxchgb %b[Exchange], %[Destination]" : [retval] "+a" (retval) : [Destination] "m" (*Destination), [Exchange] "q" (Exchange) : "memory");
 	return retval;
 }
 
-static __inline__ __attribute__((always_inline)) short _InterlockedCompareExchange16(volatile short * const Destination, const short Exchange, const short Comperand)
+__INTRIN_INLINE short _InterlockedCompareExchange16(volatile short * const Destination, const short Exchange, const short Comperand)
 {
 	short retval = Comperand;
 	__asm__("lock; cmpxchgw %w[Exchange], %[Destination]" : [retval] "+a" (retval) : [Destination] "m" (*Destination), [Exchange] "q" (Exchange): "memory");
 	return retval;
 }
 
-static __inline__ __attribute__((always_inline)) long _InterlockedCompareExchange(volatile long * const Destination, const long Exchange, const long Comperand)
+__INTRIN_INLINE long _InterlockedCompareExchange(volatile long * const Destination, const long Exchange, const long Comperand)
 {
 	long retval = Comperand;
 	__asm__("lock; cmpxchgl %k[Exchange], %[Destination]" : [retval] "+a" (retval) : [Destination] "m" (*Destination), [Exchange] "q" (Exchange): "memory");
 	return retval;
 }
 
-static __inline__ __attribute__((always_inline)) void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand)
+__INTRIN_INLINE void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand)
 {
 	void * retval = (void *)Comperand;
 	__asm__("lock; cmpxchgl %k[Exchange], %[Destination]" : [retval] "=a" (retval) : "[retval]" (retval), [Destination] "m" (*Destination), [Exchange] "q" (Exchange) : "memory");
 	return retval;
 }
 
-static __inline__ __attribute__((always_inline)) long _InterlockedExchange(volatile long * const Target, const long Value)
+__INTRIN_INLINE long _InterlockedExchange(volatile long * const Target, const long Value)
 {
 	long retval = Value;
 	__asm__("xchgl %[retval], %[Target]" : [retval] "+r" (retval) : [Target] "m" (*Target) : "memory");
 	return retval;
 }
 
-static __inline__ __attribute__((always_inline)) void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value)
+__INTRIN_INLINE void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value)
 {
 	void * retval = Value;
 	__asm__("xchgl %[retval], %[Target]" : [retval] "+r" (retval) : [Target] "m" (*Target) : "memory");
 	return retval;
 }
 
-static __inline__ __attribute__((always_inline)) long _InterlockedExchangeAdd16(volatile short * const Addend, const short Value)
+__INTRIN_INLINE long _InterlockedExchangeAdd16(volatile short * const Addend, const short Value)
 {
 	long retval = Value;
 	__asm__("lock; xaddw %[retval], %[Addend]" : [retval] "+r" (retval) : [Addend] "m" (*Addend) : "memory");
 	return retval;
 }
 
-static __inline__ __attribute__((always_inline)) long _InterlockedExchangeAdd(volatile long * const Addend, const long Value)
+__INTRIN_INLINE long _InterlockedExchangeAdd(volatile long * const Addend, const long Value)
 {
 	long retval = Value;
 	__asm__("lock; xaddl %[retval], %[Addend]" : [retval] "+r" (retval) : [Addend] "m" (*Addend) : "memory");
 	return retval;
 }
 
-static __inline__ __attribute__((always_inline)) char _InterlockedAnd8(volatile char * const value, const char mask)
+__INTRIN_INLINE char _InterlockedAnd8(volatile char * const value, const char mask)
 {
 	char x;
 	char y;
@@ -287,7 +287,7 @@
 	return y;
 }
 
-static __inline__ __attribute__((always_inline)) short _InterlockedAnd16(volatile short * const value, const short mask)
+__INTRIN_INLINE short _InterlockedAnd16(volatile short * const value, const short mask)
 {
 	short x;
 	short y;
@@ -304,7 +304,7 @@
 	return y;
 }
 
-static __inline__ __attribute__((always_inline)) long _InterlockedAnd(volatile long * const value, const long mask)
+__INTRIN_INLINE long _InterlockedAnd(volatile long * const value, const long mask)
 {
 	long x;
 	long y;
@@ -321,7 +321,7 @@
 	return y;
 }
 
-static __inline__ __attribute__((always_inline)) char _InterlockedOr8(volatile char * const value, const char mask)
+__INTRIN_INLINE char _InterlockedOr8(volatile char * const value, const char mask)
 {
 	char x;
 	char y;
@@ -338,7 +338,7 @@
 	return y;
 }
 
-static __inline__ __attribute__((always_inline)) short _InterlockedOr16(volatile short * const value, const short mask)
+__INTRIN_INLINE short _InterlockedOr16(volatile short * const value, const short mask)
 {
 	short x;
 	short y;
@@ -355,7 +355,7 @@
 	return y;
 }
 
-static __inline__ __attribute__((always_inline)) long _InterlockedOr(volatile long * const value, const long mask)
+__INTRIN_INLINE long _InterlockedOr(volatile long * const value, const long mask)
 {
 	long x;
 	long y;
@@ -372,7 +372,7 @@
 	return y;
 }
 
-static __inline__ __attribute__((always_inline)) char _InterlockedXor8(volatile char * const value, const char mask)
+__INTRIN_INLINE char _InterlockedXor8(volatile char * const value, const char mask)
 {
 	char x;
 	char y;
@@ -389,7 +389,7 @@
 	return y;
 }
 
-static __inline__ __attribute__((always_inline)) short _InterlockedXor16(volatile short * const value, const short mask)
+__INTRIN_INLINE short _InterlockedXor16(volatile short * const value, const short mask)
 {
 	short x;
 	short y;
@@ -406,7 +406,7 @@
 	return y;
 }
 
-static __inline__ __attribute__((always_inline)) long _InterlockedXor(volatile long * const value, const long mask)
+__INTRIN_INLINE long _InterlockedXor(volatile long * const value, const long mask)
 {
 	long x;
 	long y;
@@ -427,14 +427,14 @@
 
 #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) > 40100 && defined(__x86_64__)
 
-static __inline__ __attribute__((always_inline)) long long _InterlockedCompareExchange64(volatile long long * const Destination, const long long Exchange, const long long Comperand)
+__INTRIN_INLINE long long _InterlockedCompareExchange64(volatile long long * const Destination, const long long Exchange, const long long Comperand)
 {
 	return __sync_val_compare_and_swap(Destination, Comperand, Exchange);
 }
 
 #else
 
-static __inline__ __attribute__((always_inline)) long long _InterlockedCompareExchange64(volatile long long * const Destination, const long long Exchange, const long long Comperand)
+__INTRIN_INLINE long long _InterlockedCompareExchange64(volatile long long * const Destination, const long long Exchange, const long long Comperand)
 {
 	long long retval = Comperand;
 
@@ -453,7 +453,7 @@
 
 #endif
 
-static __inline__ __attribute__((always_inline)) long _InterlockedAddLargeStatistic(volatile long long * const Addend, const long Value)
+__INTRIN_INLINE long _InterlockedAddLargeStatistic(volatile long long * const Addend, const long Value)
 {
 	__asm__
 	(
@@ -469,39 +469,39 @@
 	return Value;
 }
 
-static __inline__ __attribute__((always_inline)) long _InterlockedDecrement(volatile long * const lpAddend)
+__INTRIN_INLINE long _InterlockedDecrement(volatile long * const lpAddend)
 {
 	return _InterlockedExchangeAdd(lpAddend, -1) - 1;
 }
 
-static __inline__ __attribute__((always_inline)) long _InterlockedIncrement(volatile long * const lpAddend)
+__INTRIN_INLINE long _InterlockedIncrement(volatile long * const lpAddend)
 {
 	return _InterlockedExchangeAdd(lpAddend, 1) + 1;
 }
 
-static __inline__ __attribute__((always_inline)) long _InterlockedDecrement16(volatile short * const lpAddend)
+__INTRIN_INLINE long _InterlockedDecrement16(volatile short * const lpAddend)
 {
 	return _InterlockedExchangeAdd16(lpAddend, -1) - 1;
 }
 
-static __inline__ __attribute__((always_inline)) long _InterlockedIncrement16(volatile short * const lpAddend)
+__INTRIN_INLINE long _InterlockedIncrement16(volatile short * const lpAddend)
 {
 	return _InterlockedExchangeAdd16(lpAddend, 1) + 1;
 }
 
 #if defined(_M_AMD64)
-static __inline__ __attribute__((always_inline)) long long _InterlockedDecrement64(volatile long long * const lpAddend)
+__INTRIN_INLINE long long _InterlockedDecrement64(volatile long long * const lpAddend)
 {
 	return _InterlockedExchangeAdd64(lpAddend, -1) - 1;
 }
 
-static __inline__ __attribute__((always_inline)) long long _InterlockedIncrement64(volatile long long * const lpAddend)
+__INTRIN_INLINE long long _InterlockedIncrement64(volatile long long * const lpAddend)
 {
 	return _InterlockedExchangeAdd64(lpAddend, 1) + 1;
 }
 #endif
 
-static __inline__ __attribute__((always_inline)) unsigned char _interlockedbittestandreset(volatile long * a, const long b)
+__INTRIN_INLINE unsigned char _interlockedbittestandreset(volatile long * a, const long b)
 {
 	unsigned char retval;
 	__asm__("lock; btrl %[b], %[a]; setb %b[retval]" : [retval] "=q" (retval), [a] "+m" (*a) : [b] "Ir" (b) : "memory");
@@ -509,7 +509,7 @@
 }
 
 #if defined(_M_AMD64)
-static __inline__ __attribute__((always_inline)) unsigned char _interlockedbittestandreset64(volatile long long * a, const long long b)
+__INTRIN_INLINE unsigned char _interlockedbittestandreset64(volatile long long * a, const long long b)
 {
 	unsigned char retval;
 	__asm__("lock; btrq %[b], %[a]; setb %b[retval]" : [retval] "=r" (retval), [a] "+m" (*a) : [b] "Ir" (b) : "memory");
@@ -517,7 +517,7 @@
 }
 #endif
 
-static __inline__ __attribute__((always_inline)) unsigned char _interlockedbittestandset(volatile long * a, const long b)
+__INTRIN_INLINE unsigned char _interlockedbittestandset(volatile long * a, const long b)
 {
 	unsigned char retval;
 	__asm__("lock; btsl %[b], %[a]; setc %b[retval]" : [retval] "=q" (retval), [a] "+m" (*a) : [b] "Ir" (b) : "memory");
@@ -525,7 +525,7 @@
 }
 
 #if defined(_M_AMD64)
-static __inline__ __attribute__((always_inline)) unsigned char _interlockedbittestandset64(volatile long long * a, const long long b)
+__INTRIN_INLINE unsigned char _interlockedbittestandset64(volatile long long * a, const long long b)
 {
 	unsigned char retval;
 	__asm__("lock; btsq %[b], %[a]; setc %b[retval]" : [retval] "=r" (retval), [a] "+m" (*a) : [b] "Ir" (b) : "memory");
@@ -535,7 +535,7 @@
 
 /*** String operations ***/
 /* NOTE: we don't set a memory clobber in the __stosX functions because Visual C++ doesn't */
-static __inline__ __attribute__((always_inline)) void __stosb(unsigned char * Dest, const unsigned char Data, size_t Count)
+__INTRIN_INLINE void __stosb(unsigned char * Dest, const unsigned char Data, size_t Count)
 {
 	__asm__ __volatile__
 	(
@@ -545,7 +545,7 @@
 	);
 }
 
-static __inline__ __attribute__((always_inline)) void __stosw(unsigned short * Dest, const unsigned short Data, size_t Count)
+__INTRIN_INLINE void __stosw(unsigned short * Dest, const unsigned short Data, size_t Count)
 {
 	__asm__ __volatile__
 	(
@@ -555,7 +555,7 @@
 	);
 }
 
-static __inline__ __attribute__((always_inline)) void __stosd(unsigned long * Dest, const unsigned long Data, size_t Count)
+__INTRIN_INLINE void __stosd(unsigned long * Dest, const unsigned long Data, size_t Count)
 {
 	__asm__ __volatile__
 	(
@@ -565,7 +565,7 @@
 	);
 }
 
-static __inline__ __attribute__((always_inline)) void __movsb(unsigned char * Destination, const unsigned char * Source, size_t Count)
+__INTRIN_INLINE void __movsb(unsigned char * Destination, const unsigned char * Source, size_t Count)
 {
 	__asm__ __volatile__
 	(
@@ -575,7 +575,7 @@
 	);
 }
 
-static __inline__ __attribute__((always_inline)) void __movsw(unsigned short * Destination, const unsigned short * Source, size_t Count)
+__INTRIN_INLINE void __movsw(unsigned short * Destination, const unsigned short * Source, size_t Count)
 {
 	__asm__ __volatile__
 	(
@@ -585,7 +585,7 @@
 	);
 }
 
-static __inline__ __attribute__((always_inline)) void __movsd(unsigned long * Destination, const unsigned long * Source, size_t Count)
+__INTRIN_INLINE void __movsd(unsigned long * Destination, const unsigned long * Source, size_t Count)
 {
 	__asm__ __volatile__
 	(
@@ -598,160 +598,160 @@
 #if defined(_M_AMD64)
 /*** GS segment addressing ***/
 
-static __inline__ __attribute__((always_inline)) void __writegsbyte(const unsigned long Offset, const unsigned char Data)
+__INTRIN_INLINE void __writegsbyte(const unsigned long Offset, const unsigned char Data)
 {
 	__asm__ __volatile__("movb %b[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory");
 }
 
-static __inline__ __attribute__((always_inline)) void __writegsword(const unsigned long Offset, const unsigned short Data)
+__INTRIN_INLINE void __writegsword(const unsigned long Offset, const unsigned short Data)
 {
 	__asm__ __volatile__("movw %w[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory");
 }
 
-static __inline__ __attribute__((always_inline)) void __writegsdword(const unsigned long Offset, const unsigned long Data)
+__INTRIN_INLINE void __writegsdword(const unsigned long Offset, const unsigned long Data)
 {
 	__asm__ __volatile__("movl %k[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory");
 }
 
-static __inline__ __attribute__((always_inline)) void __writegsqword(const unsigned long Offset, const unsigned __int64 Data)
+__INTRIN_INLINE void __writegsqword(const unsigned long Offset, const unsigned __int64 Data)
 {
 	__asm__ __volatile__("movq %q[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory");
 }
 
-static __inline__ __attribute__((always_inline)) unsigned char __readgsbyte(const unsigned long Offset)
+__INTRIN_INLINE unsigned char __readgsbyte(const unsigned long Offset)
 {
 	unsigned char value;
 	__asm__ __volatile__("movb %%gs:%a[Offset], %b[value]" : [value] "=q" (value) : [Offset] "irm" (Offset));
 	return value;
 }
 
-static __inline__ __attribute__((always_inline)) unsigned short __readgsword(const unsigned long Offset)
+__INTRIN_INLINE unsigned short __readgsword(const unsigned long Offset)
 {
 	unsigned short value;
 	__asm__ __volatile__("movw %%gs:%a[Offset], %w[value]" : [value] "=q" (value) : [Offset] "irm" (Offset));
 	return value;
 }
 
-static __inline__ __attribute__((always_inline)) unsigned long __readgsdword(const unsigned long Offset)
+__INTRIN_INLINE unsigned long __readgsdword(const unsigned long Offset)
 {
 	unsigned long value;
 	__asm__ __volatile__("movl %%gs:%a[Offset], %k[value]" : [value] "=q" (value) : [Offset] "irm" (Offset));
 	return value;
 }
 
-static __inline__ __attribute__((always_inline)) unsigned __int64 __readgsqword(const unsigned long Offset)
+__INTRIN_INLINE unsigned __int64 __readgsqword(const unsigned long Offset)
 {
 	unsigned __int64 value;
 	__asm__ __volatile__("movq %%gs:%a[Offset], %q[value]" : [value] "=q" (value) : [Offset] "irm" (Offset));
 	return value;
 }
 
-static __inline__ __attribute__((always_inline)) void __incgsbyte(const unsigned long Offset)
+__INTRIN_INLINE void __incgsbyte(const unsigned long Offset)
 {
 	__asm__ __volatile__("incb %%gs:%a[Offset]" : : [Offset] "ir" (Offset) : "memory");
 }
 
-static __inline__ __attribute__((always_inline)) void __incgsword(const unsigned long Offset)
+__INTRIN_INLINE void __incgsword(const unsigned long Offset)
 {
 	__asm__ __volatile__("incw %%gs:%a[Offset]" : : [Offset] "ir" (Offset) : "memory");
 }
 
-static __inline__ __attribute__((always_inline)) void __incgsdword(const unsigned long Offset)
+__INTRIN_INLINE void __incgsdword(const unsigned long Offset)
 {
 	__asm__ __volatile__("incl %%gs:%a[Offset]" : : [Offset] "ir" (Offset) : "memory");
 }
 
-static __inline__ __attribute__((always_inline)) void __addgsbyte(const unsigned long Offset, const unsigned char Data)
+__INTRIN_INLINE void __addgsbyte(const unsigned long Offset, const unsigned char Data)
 {
 	__asm__ __volatile__("addb %b[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory");
 }
 
-static __inline__ __attribute__((always_inline)) void __addgsword(const unsigned long Offset, const unsigned short Data)
+__INTRIN_INLINE void __addgsword(const unsigned long Offset, const unsigned short Data)
 {
 	__asm__ __volatile__("addw %w[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory");
 }
 
-static __inline__ __attribute__((always_inline)) void __addgsdword(const unsigned long Offset, const unsigned int Data)
+__INTRIN_INLINE void __addgsdword(const unsigned long Offset, const unsigned int Data)
 {
 	__asm__ __volatile__("addl %k[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory");
 }
 
-static __inline__ __attribute__((always_inline)) void __addgsqword(const unsigned long Offset, const unsigned __int64 Data)
+__INTRIN_INLINE void __addgsqword(const unsigned long Offset, const unsigned __int64 Data)
 {
 	__asm__ __volatile__("addq %k[Data], %%gs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory");
 }
 
 #else
 /*** FS segment addressing ***/
-static __inline__ __attribute__((always_inline)) void __writefsbyte(const unsigned long Offset, const unsigned char Data)
+__INTRIN_INLINE void __writefsbyte(const unsigned long Offset, const unsigned char Data)
 {
 	__asm__ __volatile__("movb %b[Data], %%fs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory");
 }
 
-static __inline__ __attribute__((always_inline)) void __writefsword(const unsigned long Offset, const unsigned short Data)
+__INTRIN_INLINE void __writefsword(const unsigned long Offset, const unsigned short Data)
 {
 	__asm__ __volatile__("movw %w[Data], %%fs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory");
 }
 
-static __inline__ __attribute__((always_inline)) void __writefsdword(const unsigned long Offset, const unsigned long Data)
+__INTRIN_INLINE void __writefsdword(const unsigned long Offset, const unsigned long Data)
 {
 	__asm__ __volatile__("movl %k[Data], %%fs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory");
 }
 
-static __inline__ __attribute__((always_inline)) unsigned char __readfsbyte(const unsigned long Offset)
+__INTRIN_INLINE unsigned char __readfsbyte(const unsigned long Offset)
 {
 	unsigned char value;
 	__asm__ __volatile__("movb %%fs:%a[Offset], %b[value]" : [value] "=q" (value) : [Offset] "irm" (Offset) : "memory");
 	return value;
 }
 
-static __inline__ __attribute__((always_inline)) unsigned short __readfsword(const unsigned long Offset)
+__INTRIN_INLINE unsigned short __readfsword(const unsigned long Offset)
 {
 	unsigned short value;
-	__asm__ __volatile__("movw %%fs:%a[Offset], %w[value]" : [value] "=q" (value) : [Offset] "irm" (Offset));
+	__asm__ __volatile__("movw %%fs:%a[Offset], %w[value]" : [value] "=q" (value) : [Offset] "irm" (Offset) : "memory");
 	return value;
 }
 
-static __inline__ __attribute__((always_inline)) unsigned long __readfsdword(const unsigned long Offset)
+__INTRIN_INLINE unsigned long __readfsdword(const unsigned long Offset)
 {
 	unsigned long value;
-	__asm__ __volatile__("movl %%fs:%a[Offset], %k[value]" : [value] "=q" (value) : [Offset] "irm" (Offset));
+	__asm__ __volatile__("movl %%fs:%a[Offset], %k[value]" : [value] "=q" (value) : [Offset] "irm" (Offset) : "memory");
 	return value;
 }
 
-static __inline__ __attribute__((always_inline)) void __incfsbyte(const unsigned long Offset)
+__INTRIN_INLINE void __incfsbyte(const unsigned long Offset)
 {
 	__asm__ __volatile__("incb %%fs:%a[Offset]" : : [Offset] "ir" (Offset) : "memory");
 }
 
-static __inline__ __attribute__((always_inline)) void __incfsword(const unsigned long Offset)
+__INTRIN_INLINE void __incfsword(const unsigned long Offset)
 {
 	__asm__ __volatile__("incw %%fs:%a[Offset]" : : [Offset] "ir" (Offset) : "memory");
 }
 
-static __inline__ __attribute__((always_inline)) void __incfsdword(const unsigned long Offset)
+__INTRIN_INLINE void __incfsdword(const unsigned long Offset)
 {
 	__asm__ __volatile__("incl %%fs:%a[Offset]" : : [Offset] "ir" (Offset) : "memory");
 }
 
 /* NOTE: the bizarre implementation of __addfsxxx mimics the broken Visual C++ behavior */
-static __inline__ __attribute__((always_inline)) void __addfsbyte(const unsigned long Offset, const unsigned char Data)
+__INTRIN_INLINE void __addfsbyte(const unsigned long Offset, const unsigned char Data)
 {
 	if(!__builtin_constant_p(Offset))
-		__asm__ __volatile__("addb %k[Offset], %%fs:%a[Offset]" : : [Offset] "r" (Offset) : "memory");
+		__asm__ __volatile__("addb %b[Offset], %%fs:%a[Offset]" : : [Offset] "r" (Offset) : "memory");
 	else
 		__asm__ __volatile__("addb %b[Data], %%fs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory");
 }
 
-static __inline__ __attribute__((always_inline)) void __addfsword(const unsigned long Offset, const unsigned short Data)
+__INTRIN_INLINE void __addfsword(const unsigned long Offset, const unsigned short Data)
 {
 	if(!__builtin_constant_p(Offset))
-		__asm__ __volatile__("addw %k[Offset], %%fs:%a[Offset]" : : [Offset] "r" (Offset) : "memory");
+		__asm__ __volatile__("addw %w[Offset], %%fs:%a[Offset]" : : [Offset] "r" (Offset) : "memory");
 	else
 		__asm__ __volatile__("addw %w[Data], %%fs:%a[Offset]" : : [Offset] "ir" (Offset), [Data] "iq" (Data) : "memory");
 }
 
-static __inline__ __attribute__((always_inline)) void __addfsdword(const unsigned long Offset, const unsigned int Data)
+__INTRIN_INLINE void __addfsdword(const unsigned long Offset, const unsigned int Data)
 {
 	if(!__builtin_constant_p(Offset))
 		__asm__ __volatile__("addl %k[Offset], %%fs:%a[Offset]" : : [Offset] "r" (Offset) : "memory");
@@ -762,20 +762,20 @@
 
 
 /*** Bit manipulation ***/
-static  __inline__ __attribute__((always_inline)) unsigned char _BitScanForward(unsigned long * const Index, const unsigned long Mask)
+__INTRIN_INLINE unsigned char _BitScanForward(unsigned long * const Index, const unsigned long Mask)
 {
 	__asm__("bsfl %[Mask], %[Index]" : [Index] "=r" (*Index) : [Mask] "mr" (Mask));
 	return Mask ? 1 : 0;
 }
 
-static  __inline__ __attribute__((always_inline)) unsigned char _BitScanReverse(unsigned long * const Index, const unsigned long Mask)
+__INTRIN_INLINE unsigned char _BitScanReverse(unsigned long * const Index, const unsigned long Mask)
 {
 	__asm__("bsrl %[Mask], %[Index]" : [Index] "=r" (*Index) : [Mask] "mr" (Mask));
 	return Mask ? 1 : 0;
 }
 
 /* NOTE: again, the bizarre implementation follows Visual C++ */
-static  __inline__ __attribute__((always_inline)) unsigned char _bittest(const long * const a, const long b)
+__INTRIN_INLINE unsigned char _bittest(const long * const a, const long b)
 {
 	unsigned char retval;
 
@@ -787,7 +787,7 @@
 	return retval;
 }
 
-static __inline__ __attribute__((always_inline)) unsigned char _bittestandcomplement(long * const a, const long b)
+__INTRIN_INLINE unsigned char _bittestandcomplement(long * const a, const long b)
 {
 	unsigned char retval;
 
@@ -799,7 +799,7 @@
 	return retval;
 }
 
-static __inline__ __attribute__((always_inline)) unsigned char _bittestandreset(long * const a, const long b)
+__INTRIN_INLINE unsigned char _bittestandreset(long * const a, const long b)
 {
 	unsigned char retval;
 
@@ -811,7 +811,7 @@
 	return retval;
 }
 
-static __inline__ __attribute__((always_inline)) unsigned char _bittestandset(long * const a, const long b)
+__INTRIN_INLINE unsigned char _bittestandset(long * const a, const long b)
 {
 	unsigned char retval;
 
@@ -823,14 +823,14 @@
 	return retval;
 }
 
-static __inline__ __attribute__((always_inline)) unsigned char _rotl8(unsigned char value, unsigned char shift)
+__INTRIN_INLINE unsigned char _rotl8(unsigned char value, unsigned char shift)
 {
 	unsigned char retval;
 	__asm__("rolb %b[shift], %b[retval]" : [retval] "=rm" (retval) : "[retval]" (value), [shift] "Nc" (shift));
 	return retval;
 }
 
-static __inline__ __attribute__((always_inline)) unsigned short _rotl16(unsigned short value, unsigned char shift)
+__INTRIN_INLINE unsigned short _rotl16(unsigned short value, unsigned char shift)
 {
 	unsigned short retval;
 	__asm__("rolw %b[shift], %w[retval]" : [retval] "=rm" (retval) : "[retval]" (value), [shift] "Nc" (shift));
@@ -838,14 +838,14 @@
 }
 
 #ifndef __MSVCRT__
-static __inline__ __attribute__((always_inline)) unsigned int _rotl(unsigned int value, int shift)
+__INTRIN_INLINE unsigned int _rotl(unsigned int value, int shift)
 {
 	unsigned long retval;
 	__asm__("roll %b[shift], %k[retval]" : [retval] "=rm" (retval) : "[retval]" (value), [shift] "Nc" (shift));
 	return retval;
 }
 
-static __inline__ __attribute__((always_inline)) unsigned int _rotr(unsigned int value, int shift)
+__INTRIN_INLINE unsigned int _rotr(unsigned int value, int shift)
 {
 	unsigned long retval;
 	__asm__("rorl %b[shift], %k[retval]" : [retval] "=rm" (retval) : "[retval]" (value), [shift] "Nc" (shift));
@@ -853,14 +853,14 @@
 }
 #endif
 
-static __inline__ __attribute__((always_inline)) unsigned char _rotr8(unsigned char value, unsigned char shift)
+__INTRIN_INLINE unsigned char _rotr8(unsigned char value, unsigned char shift)
 {
 	unsigned char retval;
 	__asm__("rorb %b[shift], %b[retval]" : [retval] "=rm" (retval) : "[retval]" (value), [shift] "Nc" (shift));
 	return retval;
 }
 
-static __inline__ __attribute__((always_inline)) unsigned short _rotr16(unsigned short value, unsigned char shift)
+__INTRIN_INLINE unsigned short _rotr16(unsigned short value, unsigned char shift)
 {
 	unsigned short retval;
 	__asm__("rorw %b[shift], %w[retval]" : [retval] "=rm" (retval) : "[retval]" (value), [shift] "Nc" (shift));
@@ -874,7 +874,7 @@
 	just confuses it. Also we declare Bit as an int and then truncate it to
 	match Visual C++ behavior
 */
-static __inline__ __attribute__((always_inline)) unsigned long long __ll_lshift(const unsigned long long Mask, const int Bit)
+__INTRIN_INLINE unsigned long long __ll_lshift(const unsigned long long Mask, const int Bit)
 {
 	unsigned long long retval = Mask;
 
@@ -888,7 +888,7 @@
 	return retval;
 }
 
-static __inline__ __attribute__((always_inline)) long long __ll_rshift(const long long Mask, const int Bit)
+__INTRIN_INLINE long long __ll_rshift(const long long Mask, const int Bit)
 {
 	unsigned long long retval = Mask;
 
@@ -902,7 +902,7 @@
 	return retval;
 }
 
-static __inline__ __attribute__((always_inline)) unsigned long long __ull_rshift(const unsigned long long Mask, int Bit)
+__INTRIN_INLINE unsigned long long __ull_rshift(const unsigned long long Mask, int Bit)
 {
 	unsigned long long retval = Mask;
 
@@ -916,14 +916,14 @@
 	return retval;
 }
 
-static __inline__ __attribute__((always_inline)) unsigned short _byteswap_ushort(unsigned short value)
+__INTRIN_INLINE unsigned short _byteswap_ushort(unsigned short value)
 {
 	unsigned short retval;
 	__asm__("rorw $8, %w[retval]" : [retval] "=rm" (retval) : "[retval]" (value));
 	return retval;
 }
 
-static __inline__ __attribute__((always_inline)) unsigned long _byteswap_ulong(unsigned long value)
+__INTRIN_INLINE unsigned long _byteswap_ulong(unsigned long value)
 {
 	unsigned long retval;
 	__asm__("bswapl %[retval]" : [retval] "=rm" (retval) : "[retval]" (value));
@@ -931,14 +931,14 @@
 }
 
 #ifdef _M_AMD64
-static __inline__ __attribute__((always_inline)) unsigned __int64 _byteswap_uint64(unsigned __int64 value)
+__INTRIN_INLINE unsigned __int64 _byteswap_uint64(unsigned __int64 value)
 {
 	unsigned __int64 retval;
 	__asm__("bswapq %[retval]" : [retval] "=rm" (retval) : "[retval]" (value));
 	return retval;
 }
 #else
-static __inline__ __attribute__((always_inline)) unsigned __int64 _byteswap_uint64(unsigned __int64 value)
+__INTRIN_INLINE unsigned __int64 _byteswap_uint64(unsigned __int64 value)
 {
 	union {
 		__int64 int64part;
@@ -956,14 +956,14 @@
 #endif
 
 /*** 64-bit math ***/
-static __inline__ __attribute__((always_inline)) long long __emul(const int a, const int b)
+__INTRIN_INLINE long long __emul(const int a, const int b)
 {
 	long long retval;
 	__asm__("imull %[b]" : "=A" (retval) : [a] "a" (a), [b] "rm" (b));
 	return retval;
 }
 
-static __inline__ __attribute__((always_inline)) unsigned long long __emulu(const unsigned int a, const unsigned int b)
+__INTRIN_INLINE unsigned long long __emulu(const unsigned int a, const unsigned int b)
 {
 	unsigned long long retval;
 	__asm__("mull %[b]" : "=A" (retval) : [a] "a" (a), [b] "rm" (b));
@@ -972,28 +972,28 @@
 
 
 /*** Port I/O ***/
-static __inline__ __attribute__((always_inline)) unsigned char __inbyte(const unsigned short Port)
+__INTRIN_INLINE unsigned char __inbyte(const unsigned short Port)
 {
 	unsigned char byte;
 	__asm__ __volatile__("inb %w[Port], %b[byte]" : [byte] "=a" (byte) : [Port] "Nd" (Port));
 	return byte;
 }
 
-static __inline__ __attribute__((always_inline)) unsigned short __inword(const unsigned short Port)
+__INTRIN_INLINE unsigned short __inword(const unsigned short Port)
 {
 	unsigned short word;
 	__asm__ __volatile__("inw %w[Port], %w[word]" : [word] "=a" (word) : [Port] "Nd" (Port));
 	return word;
 }
 
-static __inline__ __attribute__((always_inline)) unsigned long __indword(const unsigned short Port)
+__INTRIN_INLINE unsigned long __indword(const unsigned short Port)
 {
 	unsigned long dword;
 	__asm__ __volatile__("inl %w[Port], %k[dword]" : [dword] "=a" (dword) : [Port] "Nd" (Port));
 	return dword;
 }
 
-static __inline__ __attribute__((always_inline)) void __inbytestring(unsigned short Port, unsigned char * Buffer, unsigned long Count)
+__INTRIN_INLINE void __inbytestring(unsigned short Port, unsigned char * Buffer, unsigned long Count)
 {
 	__asm__ __volatile__
 	(
@@ -1004,7 +1004,7 @@
 	);
 }
 
-static __inline__ __attribute__((always_inline)) void __inwordstring(unsigned short Port, unsigned short * Buffer, unsigned long Count)
+__INTRIN_INLINE void __inwordstring(unsigned short Port, unsigned short * Buffer, unsigned long Count)
 {
 	__asm__ __volatile__
 	(
@@ -1015,7 +1015,7 @@
 	);
 }
 
-static __inline__ __attribute__((always_inline)) void __indwordstring(unsigned short Port, unsigned long * Buffer, unsigned long Count)
+__INTRIN_INLINE void __indwordstring(unsigned short Port, unsigned long * Buffer, unsigned long Count)
 {
 	__asm__ __volatile__
 	(
@@ -1026,44 +1026,44 @@
 	);
 }
 
-static __inline__ __attribute__((always_inline)) void __outbyte(unsigned short const Port, const unsigned char Data)
+__INTRIN_INLINE void __outbyte(unsigned short const Port, const unsigned char Data)
 {
 	__asm__ __volatile__("outb %b[Data], %w[Port]" : : [Port] "Nd" (Port), [Data] "a" (Data));
 }
 
-static __inline__ __attribute__((always_inline)) void __outword(unsigned short const Port, const unsigned short Data)
+__INTRIN_INLINE void __outword(unsigned short const Port, const unsigned short Data)
 {
 	__asm__ __volatile__("outw %w[Data], %w[Port]" : : [Port] "Nd" (Port), [Data] "a" (Data));
 }
 
-static __inline__ __attribute__((always_inline)) void __outdword(unsigned short const Port, const unsigned long Data)
+__INTRIN_INLINE void __outdword(unsigned short const Port, const unsigned long Data)
 {
 	__asm__ __volatile__("outl %k[Data], %w[Port]" : : [Port] "Nd" (Port), [Data] "a" (Data));
 }
 
-static __inline__ __attribute__((always_inline)) void __outbytestring(unsigned short const Port, const unsigned char * const Buffer, const unsigned long Count)
+__INTRIN_INLINE void __outbytestring(unsigned short const Port, const unsigned char * const Buffer, const unsigned long Count)
 {
 	__asm__ __volatile__("rep; outsb" : : [Port] "d" (Port), [Buffer] "S" (Buffer), "c" (Count));
 }
 
-static __inline__ __attribute__((always_inline)) void __outwordstring(unsigned short const Port, const unsigned short * const Buffer, const unsigned long Count)
+__INTRIN_INLINE void __outwordstring(unsigned short const Port, const unsigned short * const Buffer, const unsigned long Count)
 {
 	__asm__ __volatile__("rep; outsw" : : [Port] "d" (Port), [Buffer] "S" (Buffer), "c" (Count));
 }
 
-static __inline__ __attribute__((always_inline)) void __outdwordstring(unsigned short const Port, const unsigned long * const Buffer, const unsigned long Count)
+__INTRIN_INLINE void __outdwordstring(unsigned short const Port, const unsigned long * const Buffer, const unsigned long Count)
 {
 	__asm__ __volatile__("rep; outsl" : : [Port] "d" (Port), [Buffer] "S" (Buffer), "c" (Count));
 }
 
 
 /*** System information ***/
-static __inline__ __attribute__((always_inline)) void __cpuid(int CPUInfo[], const int InfoType)
+__INTRIN_INLINE void __cpuid(int CPUInfo[], const int InfoType)
 {
 	__asm__ __volatile__("cpuid" : "=a" (CPUInfo[0]), "=b" (CPUInfo[1]), "=c" (CPUInfo[2]), "=d" (CPUInfo[3]) : "a" (InfoType));
 }
 
-static __inline__ __attribute__((always_inline)) unsigned long long __rdtsc(void)
+__INTRIN_INLINE unsigned long long __rdtsc(void)
 {
 #ifdef _M_AMD64
 	unsigned long long low, high;
@@ -1076,12 +1076,12 @@
 #endif
 }
 
-static __inline__ __attribute__((always_inline)) void __writeeflags(uintptr_t Value)
+__INTRIN_INLINE void __writeeflags(uintptr_t Value)
 {
 	__asm__ __volatile__("push %0\n popf" : : "rim"(Value));
 }
 
-static __inline__ __attribute__((always_inline)) uintptr_t __readeflags(void)
+__INTRIN_INLINE uintptr_t __readeflags(void)
 {
 	uintptr_t retval;
 	__asm__ __volatile__("pushf\n pop %0" : "=rm"(retval));
@@ -1089,22 +1089,22 @@
 }
 
 /*** Interrupts ***/
-static __inline__ __attribute__((always_inline)) void __debugbreak(void)
+__INTRIN_INLINE void __debugbreak(void)
 {
 	__asm__("int $3");
 }
 
-static __inline__ __attribute__((always_inline)) void __int2c(void)
+__INTRIN_INLINE void __int2c(void)
 {
 	__asm__("int $0x2c");
 }
 
-static __inline__ __attribute__((always_inline)) void _disable(void)
+__INTRIN_INLINE void _disable(void)
 {
 	__asm__("cli");
 }
 
-static __inline__ __attribute__((always_inline)) void _enable(void)
+__INTRIN_INLINE void _enable(void)
 {
 	__asm__("sti");
 }
@@ -1112,50 +1112,50 @@
 
 /*** Protected memory management ***/
 
-static __inline__ __attribute__((always_inline)) void __writecr0(const unsigned __int64 Data)
+__INTRIN_INLINE void __writecr0(const unsigned __int64 Data)
 {
 	__asm__("mov %[Data], %%cr0" : : [Data] "q" (Data) : "memory");
 }
 
-static __inline__ __attribute__((always_inline)) void __writecr3(const unsigned __int64 Data)
+__INTRIN_INLINE void __writecr3(const unsigned __int64 Data)
 {
 	__asm__("mov %[Data], %%cr3" : : [Data] "q" (Data) : "memory");
 }
 
-static __inline__ __attribute__((always_inline)) void __writecr4(const unsigned __int64 Data)
+__INTRIN_INLINE void __writecr4(const unsigned __int64 Data)
 {
 	__asm__("mov %[Data], %%cr4" : : [Data] "q" (Data) : "memory");
 }
 
 #ifdef _M_AMD64
-static __inline__ __attribute__((always_inline)) void __writecr8(const unsigned __int64 Data)
+__INTRIN_INLINE void __writecr8(const unsigned __int64 Data)
 {
 	__asm__("mov %[Data], %%cr8" : : [Data] "q" (Data) : "memory");
 }
 #endif
 
-static __inline__ __attribute__((always_inline)) unsigned __int64 __readcr0(void)
+__INTRIN_INLINE unsigned __int64 __readcr0(void)
 {
 	unsigned __int64 value;
 	__asm__ __volatile__("mov %%cr0, %[value]" : [value] "=q" (value));
 	return value;
 }
 
-static __inline__ __attribute__((always_inline)) unsigned __int64 __readcr2(void)
+__INTRIN_INLINE unsigned __int64 __readcr2(void)
 {
 	unsigned __int64 value;
 	__asm__ __volatile__("mov %%cr2, %[value]" : [value] "=q" (value));
 	return value;
 }
 
-static __inline__ __attribute__((always_inline)) unsigned __int64 __readcr3(void)
+__INTRIN_INLINE unsigned __int64 __readcr3(void)
 {
 	unsigned __int64 value;
 	__asm__ __volatile__("mov %%cr3, %[value]" : [value] "=q" (value));
 	return value;
 }
 
-static __inline__ __attribute__((always_inline)) unsigned __int64 __readcr4(void)
+__INTRIN_INLINE unsigned __int64 __readcr4(void)
 {
 	unsigned __int64 value;
 	__asm__ __volatile__("mov %%cr4, %[value]" : [value] "=q" (value));
@@ -1163,7 +1163,7 @@
 }
 
 #ifdef _M_AMD64
-static __inline__ __attribute__((always_inline)) unsigned __int64 __readcr8(void)
+__INTRIN_INLINE unsigned __int64 __readcr8(void)
 {
 	unsigned __int64 value;
 	__asm__ __volatile__("movq %%cr8, %q[value]" : [value] "=q" (value));
@@ -1172,7 +1172,7 @@
 #endif
 
 #ifdef _M_AMD64
-static __inline__ __attribute__((always_inline)) unsigned __int64 __readdr(unsigned int reg)
+__INTRIN_INLINE unsigned __int64 __readdr(unsigned int reg)
 {
 	unsigned __int64 value;
 	switch (reg)
@@ -1205,7 +1205,7 @@
 	return value;
 }
 
-static __inline__ __attribute__((always_inline)) void __writedr(unsigned reg, unsigned __int64 value)
+__INTRIN_INLINE void __writedr(unsigned reg, unsigned __int64 value)
 {
 	switch (reg)
 	{
@@ -1237,14 +1237,14 @@
 }
 #endif
 
-static __inline__ __attribute__((always_inline)) void __invlpg(void * const Address)
+__INTRIN_INLINE void __invlpg(void * const Address)
 {
 	__asm__("invlpg %[Address]" : : [Address] "m" (*((unsigned char *)(Address))));
 }
 
 
 /*** System operations ***/
-static __inline__ __attribute__((always_inline)) unsigned long long __readmsr(const int reg)
+__INTRIN_INLINE unsigned long long __readmsr(const int reg)
 {
 #ifdef _M_AMD64
 	unsigned long low, high;
@@ -1257,7 +1257,7 @@
 #endif
 }
 
-static __inline__ __attribute__((always_inline)) void __writemsr(const unsigned long Register, const unsigned long long Value)
+__INTRIN_INLINE void __writemsr(const unsigned long Register, const unsigned long long Value)
 {
 #ifdef _M_AMD64
 	__asm__ __volatile__("wrmsr" : : "a" (Value), "d" (Value >> 32), "c" (Register));
@@ -1266,7 +1266,7 @@
 #endif
 }
 
-static __inline__ __attribute__((always_inline)) unsigned long long __readpmc(const int counter)
+__INTRIN_INLINE unsigned long long __readpmc(const int counter)
 {
 	unsigned long long retval;
 	__asm__ __volatile__("rdpmc" : "=A" (retval) : "c" (counter));
@@ -1274,29 +1274,29 @@
 }
 
 /* NOTE: an immediate value for 'a' will raise an ICE in Visual C++ */
-static __inline__ __attribute__((always_inline)) unsigned long __segmentlimit(const unsigned long a)
+__INTRIN_INLINE unsigned long __segmentlimit(const unsigned long a)
 {
 	unsigned long retval;
 	__asm__ __volatile__("lsl %[a], %[retval]" : [retval] "=r" (retval) : [a] "rm" (a));
 	return retval;
 }
 
-static __inline__ __attribute__((always_inline)) void __wbinvd(void)
+__INTRIN_INLINE void __wbinvd(void)
 {
 	__asm__ __volatile__("wbinvd");
 }
 
-static __inline__ __attribute__((always_inline)) void __lidt(void *Source)
+__INTRIN_INLINE void __lidt(void *Source)
 {
 	__asm__ __volatile__("lidt %0" : : "m"(*(short*)Source));
 }
 
-static __inline__ __attribute__((always_inline)) void __sidt(void *Destination)
+__INTRIN_INLINE void __sidt(void *Destination)
 {
 	__asm__ __volatile__("sidt %0" : : "m"(*(short*)Destination) : "memory");
 }
 
-static __inline__ __attribute__((always_inline)) void _mm_pause(void)
+__INTRIN_INLINE void _mm_pause(void)
 {
 	__asm__ __volatile__("pause");
 }

Propchange: trunk/reactos/include/crt/msc/
------------------------------------------------------------------------------
--- bugtraq:logregex (added)
+++ bugtraq:logregex Tue Jun 16 04:24:26 2009
@@ -1,0 +1,2 @@
+([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))?
+(\d+)

Propchange: trunk/reactos/include/crt/msc/
------------------------------------------------------------------------------
    bugtraq:message = See issue #%BUGID% for more details.

Propchange: trunk/reactos/include/crt/msc/
------------------------------------------------------------------------------
    bugtraq:url = http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%

Propchange: trunk/reactos/include/crt/msc/
------------------------------------------------------------------------------
    tsvn:logminsize = 10

Added: trunk/reactos/include/crt/msc/intrin.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/msc/intrin.h?rev=41421&view=auto
==============================================================================
--- trunk/reactos/include/crt/msc/intrin.h (added)
+++ trunk/reactos/include/crt/msc/intrin.h [iso-8859-1] Tue Jun 16 04:24:26 2009
@@ -1,0 +1,188 @@
+#ifndef KJK_INTRIN_H_
+#define KJK_INTRIN_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*** Stack frame juggling ***/
+void * _ReturnAddress(void);
+void * _AddressOfReturnAddress(void);
+unsigned int __getcallerseflags(void);
+
+/*** Atomic operations ***/
+void _ReadWriteBarrier(void);
+void _ReadBarrier(void);
+void _WriteBarrier(void);
+
+char _InterlockedCompareExchange8(volatile char * const Destination, const char Exchange, const char Comperand);
+short _InterlockedCompareExchange16(volatile short * const Destination, const short Exchange, const short Comperand);
+long _InterlockedCompareExchange(volatile long * const Destination, const long Exchange, const long Comperand);
+void * _InterlockedCompareExchangePointer(void * volatile * const Destination, void * const Exchange, void * const Comperand);
+long _InterlockedExchange(volatile long * const Target, const long Value);
+void * _InterlockedExchangePointer(void * volatile * const Target, void * const Value);
+long _InterlockedExchangeAdd16(volatile short * const Addend, const short Value);
+long _InterlockedExchangeAdd(volatile long * const Addend, const long Value);
+char _InterlockedAnd8(volatile char * const value, const char mask);
+short _InterlockedAnd16(volatile short * const value, const short mask);
+long _InterlockedAnd(volatile long * const value, const long mask);
+char _InterlockedOr8(volatile char * const value, const char mask);
+short _InterlockedOr16(volatile short * const value, const short mask);
+long _InterlockedOr(volatile long * const value, const long mask);
+char _InterlockedXor8(volatile char * const value, const char mask);
+short _InterlockedXor16(volatile short * const value, const short mask);
+long _InterlockedXor(volatile long * const value, const long mask);
+long _InterlockedAddLargeStatistic(volatile __int64 * const Addend, const long Value);
+long _InterlockedDecrement(volatile long * const lpAddend);
+long _InterlockedIncrement(volatile long * const lpAddend);
+long _InterlockedDecrement16(volatile short * const lpAddend);
+long _InterlockedIncrement16(volatile short * const lpAddend);
+unsigned char _interlockedbittestandreset(volatile long * a, const long b);
+unsigned char _interlockedbittestandset(volatile long * a, const long b);
+
+#if defined(_M_AMD64)
+__int64 _InterlockedExchange64(volatile __int64 * const Target, const __int64 Value);
+__int64 _InterlockedExchangeAdd64(volatile __int64 * const Addend, const __int64 Value);
+long _InterlockedAnd64(volatile __int64 * const value, const __int64 mask);
+long _InterlockedOr64(volatile __int64 * const value, const __int64 mask);
+__int64 _InterlockedCompareExchange64(volatile __int64 * const Destination, const __int64 Exchange, const __int64 Comperand);
+__int64 _InterlockedDecrement64(volatile __int64 * const lpAddend);
+__int64 _InterlockedIncrement64(volatile __int64 * const lpAddend);
+unsigned char _interlockedbittestandreset64(volatile __int64 * a, const __int64 b);
+unsigned char _interlockedbittestandset64(volatile __int64 * a, const __int64 b);
+#endif
+
+/*** String operations ***/
+void __stosb(unsigned char * Dest, const unsigned char Data, size_t Count);
+void __stosw(unsigned short * Dest, const unsigned short Data, size_t Count);
+void __stosd(unsigned long * Dest, const unsigned long Data, size_t Count);
+void __movsb(unsigned char * Destination, const unsigned char * Source, size_t Count);
+void __movsw(unsigned short * Destination, const unsigned short * Source, size_t Count);
+void __movsd(unsigned long * Destination, const unsigned long * Source, size_t Count);
+
+#if defined(_M_AMD64)
+/*** GS segment addressing ***/
+void __writegsbyte(const unsigned long Offset, const unsigned char Data);
+void __writegsword(const unsigned long Offset, const unsigned short Data);
+void __writegsdword(const unsigned long Offset, const unsigned long Data);
+void __writegsqword(const unsigned long Offset, const unsigned __int64 Data);
+unsigned char __readgsbyte(const unsigned long Offset);
+unsigned short __readgsword(const unsigned long Offset);
+unsigned long __readgsdword(const unsigned long Offset);
+unsigned __int64 __readgsqword(const unsigned long Offset);
+void __incgsbyte(const unsigned long Offset);
+void __incgsword(const unsigned long Offset);
+void __incgsdword(const unsigned long Offset);
+void __addgsbyte(const unsigned long Offset, const unsigned char Data);
+void __addgsword(const unsigned long Offset, const unsigned short Data);
+void __addgsdword(const unsigned long Offset, const unsigned int Data);
+void __addgsqword(const unsigned long Offset, const unsigned __int64 Data);
+#endif
+
+#if defined(_M_IX86)
+/*** FS segment addressing ***/
+void __writefsbyte(const unsigned long Offset, const unsigned char Data);
+void __writefsword(const unsigned long Offset, const unsigned short Data);
+void __writefsdword(const unsigned long Offset, const unsigned long Data);
+unsigned char __readfsbyte(const unsigned long Offset);
+unsigned short __readfsword(const unsigned long Offset);
+unsigned long __readfsdword(const unsigned long Offset);
+void __incfsbyte(const unsigned long Offset);
+void __incfsword(const unsigned long Offset);
+void __incfsdword(const unsigned long Offset);
+void __addfsbyte(const unsigned long Offset, const unsigned char Data);
+void __addfsword(const unsigned long Offset, const unsigned short Data);
+void __addfsdword(const unsigned long Offset, const unsigned int Data)
+#endif
+
+
+/*** Bit manipulation ***/
+unsigned char _BitScanForward(unsigned long * const Index, const unsigned long Mask);
+unsigned char _BitScanReverse(unsigned long * const Index, const unsigned long Mask);
+unsigned char _bittest(const long * const a, const long b);
+unsigned char _bittestandcomplement(long * const a, const long b);
+unsigned char _bittestandreset(long * const a, const long b);
+unsigned char _bittestandset(long * const a, const long b);
+unsigned char _rotl8(unsigned char value, unsigned char shift);
+unsigned short _rotl16(unsigned short value, unsigned char shift);
+unsigned int _rotl(unsigned int value, int shift);
+unsigned int _rotr(unsigned int value, int shift);
+unsigned char _rotr8(unsigned char value, unsigned char shift);
+unsigned short _rotr16(unsigned short value, unsigned char shift);
+unsigned __int64 __ll_lshift(const unsigned __int64 Mask, const int Bit);
+__int64 __ll_rshift(const __int64 Mask, const int Bit);
+unsigned __int64 __ull_rshift(const unsigned __int64 Mask, int Bit);
+unsigned short _byteswap_ushort(unsigned short value);
+unsigned long _byteswap_ulong(unsigned long value);
+unsigned __int64 _byteswap_uint64(unsigned __int64 value);
+
+/*** 64-bit math ***/
+__int64 __emul(const int a, const int b);
+unsigned __int64 __emulu(const unsigned int a, const unsigned int b);
+
+/*** Port I/O ***/
+unsigned char __inbyte(const unsigned short Port);
+unsigned short __inword(const unsigned short Port);
+unsigned long __indword(const unsigned short Port);
+void __inbytestring(unsigned short Port, unsigned char * Buffer, unsigned long Count);
+void __inwordstring(unsigned short Port, unsigned short * Buffer, unsigned long Count);
+void __indwordstring(unsigned short Port, unsigned long * Buffer, unsigned long Count);
+void __outbyte(unsigned short const Port, const unsigned char Data);
+void __outword(unsigned short const Port, const unsigned short Data);
+void __outdword(unsigned short const Port, const unsigned long Data);
+void __outbytestring(unsigned short const Port, const unsigned char * const Buffer, const unsigned long Count);
+void __outwordstring(unsigned short const Port, const unsigned short * const Buffer, const unsigned long Count);
+void __outdwordstring(unsigned short const Port, const unsigned long * const Buffer, const unsigned long Count);
+
+/*** System information ***/
+void __cpuid(int CPUInfo[], const int InfoType);
+unsigned __int64 __rdtsc(void);
+void __writeeflags(uintptr_t Value);
+uintptr_t __readeflags(void);
+
+/*** Interrupts ***/
+void __debugbreak(void);
+void __int2c(void);
+void _disable(void);
+void _enable(void);
+
+/*** Protected memory management ***/
+void __writecr0(const unsigned __int64 Data);
+void __writecr3(const unsigned __int64 Data);
+void __writecr4(const unsigned __int64 Data);
+
+#ifdef _M_AMD64
+void __writecr8(const unsigned __int64 Data);
+#endif
+
+unsigned __int64 __readcr0(void);
+unsigned __int64 __readcr2(void);
+unsigned __int64 __readcr3(void);
+unsigned __int64 __readcr4(void);
+
+#ifdef _M_AMD64
+unsigned __int64 __readcr8(void);
+#endif
+
+unsigned __int64 __readdr(unsigned int reg);
+void __writedr(unsigned reg, unsigned __int64 value);
+
+void __invlpg(void * const Address);
+
+/*** System operations ***/
+unsigned __int64 __readmsr(const int reg);
+void __writemsr(const unsigned long Register, const unsigned __int64 Value);
+unsigned __int64 __readpmc(const int counter);
+unsigned long __segmentlimit(const unsigned long a);
+void __wbinvd(void);
+void __lidt(void *Source);
+void __sidt(void *Destination);
+void _mm_pause(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* KJK_INTRIN_H_ */
+
+/* EOF */

Propchange: trunk/reactos/include/crt/msc/intrin.h
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: trunk/reactos/include/crt/stdio.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/stdio.h?rev=41421&r1=41420&r2=41421&view=diff
==============================================================================
--- trunk/reactos/include/crt/stdio.h [iso-8859-1] (original)
+++ trunk/reactos/include/crt/stdio.h [iso-8859-1] Tue Jun 16 04:24:26 2009
@@ -7,6 +7,9 @@
 #define _INC_STDIO
 
 #include <crtdefs.h>
+
+#define __need___va_list
+#include <stdarg.h>
 
 #pragma pack(push,_CRT_PACKING)
 

Modified: trunk/reactos/include/crt/wchar.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/wchar.h?rev=41421&r1=41420&r2=41421&view=diff
==============================================================================
--- trunk/reactos/include/crt/wchar.h [iso-8859-1] (original)
+++ trunk/reactos/include/crt/wchar.h [iso-8859-1] Tue Jun 16 04:24:26 2009
@@ -7,6 +7,9 @@
 #define _INC_WCHAR
 
 #include <crtdefs.h>
+
+#define __need___va_list
+#include <stdarg.h>
 
 #pragma pack(push,_CRT_PACKING)
 



More information about the Ros-diffs mailing list