Author: tkreuzer
Date: Tue Feb 3 13:51:09 2009
New Revision: 39346
URL:
http://svn.reactos.org/svn/reactos?rev=39346&view=rev
Log:
[NDK] Use intrinsics for rtl byteswap functions for GNUC, too. Only include them if
NTOS_MODE_USER. Fuctions are only present for NTDDI_VERSION >= NTDDI_WIN2K
Modified:
branches/ros-amd64-bringup/reactos/include/ndk/rtlfuncs.h
Modified: branches/ros-amd64-bringup/reactos/include/ndk/rtlfuncs.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/inclu…
==============================================================================
--- branches/ros-amd64-bringup/reactos/include/ndk/rtlfuncs.h [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/include/ndk/rtlfuncs.h [iso-8859-1] Tue Feb 3
13:51:09 2009
@@ -1370,6 +1370,8 @@
//
// Byte Swap Functions
//
+#ifdef NTOS_MODE_USER
+
#if (defined(_M_IX86) && (_MSC_FULL_VER > 13009037)) || \
((defined(_M_AMD64) || \
defined(_M_IA64)) && (_MSC_FULL_VER > 13009175))
@@ -1384,8 +1386,15 @@
#define RtlUlongByteSwap(_x) _byteswap_ulong((_x))
#define RtlUlonglongByteSwap(_x) _byteswap_uint64((_x))
+#elif defined (__GNUC__)
+
+#define RtlUshortByteSwap(_x) _byteswap_ushort((USHORT)(_x))
+#define RtlUlongByteSwap(_x) _byteswap_ulong((_x))
+#define RtlUlonglongByteSwap(_x) _byteswap_uint64((_x))
+
#else
+#if (NTDDI_VERSION >= NTDDI_WIN2K)
NTSYSAPI
USHORT
FASTCALL
@@ -1400,8 +1409,10 @@
ULONGLONG
FASTCALL
RtlUlonglongByteSwap(IN ULONGLONG Source);
-
#endif
+
+#endif
+#endif // NTOS_MODE_USER
//
// Unicode->Ansi String Functions