From d9e96afb6d8e9c6d6a9e53ba29ac148e68eb51bd Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Tue, 1 Apr 2008 17:49:03 +0000 Subject: [PATCH] - Implement inline version of _rotl. The Win32 version of the CRT has this function in the standard library, but the NT one doesn't, so we need to rely on the inline version (which MSVC supports). svn path=/trunk/; revision=32808 --- reactos/include/psdk/intrin_x86.h | 9 +++++++++ reactos/lib/rtl/rtl.h | 1 + reactos/ntoskrnl/include/ntoskrnl.h | 1 + 3 files changed, 11 insertions(+) diff --git a/reactos/include/psdk/intrin_x86.h b/reactos/include/psdk/intrin_x86.h index 26ca223e3d6..6aa7be4f22e 100644 --- a/reactos/include/psdk/intrin_x86.h +++ b/reactos/include/psdk/intrin_x86.h @@ -680,6 +680,15 @@ static __inline__ __attribute__((always_inline)) unsigned short _rotl16(const un return retval; } +#ifndef __MSVCRT__ +static __inline__ __attribute__((always_inline)) unsigned short _rotl(const unsigned long value, const unsigned char shift) +{ + unsigned short retval; + __asm__("roll %b[shift], %w[retval]" : [retval] "=rm" (retval) : "[retval]" (value), [shift] "Nc" (shift)); + return retval; +} +#endif + static __inline__ __attribute__((always_inline)) unsigned char _rotr8(const unsigned char value, const unsigned char shift) { unsigned char retval; diff --git a/reactos/lib/rtl/rtl.h b/reactos/lib/rtl/rtl.h index a557d834621..7f1eaf73ad7 100644 --- a/reactos/lib/rtl/rtl.h +++ b/reactos/lib/rtl/rtl.h @@ -14,6 +14,7 @@ /* We're a core NT DLL, we don't import syscalls */ #define WIN32_NO_STATUS #define _INC_SWPRINTF_INL_ +#undef __MSVCRT__ /* C Headers */ #include diff --git a/reactos/ntoskrnl/include/ntoskrnl.h b/reactos/ntoskrnl/include/ntoskrnl.h index 775f99300eb..de9c03c85ff 100644 --- a/reactos/ntoskrnl/include/ntoskrnl.h +++ b/reactos/ntoskrnl/include/ntoskrnl.h @@ -9,6 +9,7 @@ /* INCLUDES ******************************************************************/ /* Version Data */ +#undef __MSVCRT__ #include #define _WIN32_WINNT _WIN32_WINNT_WS03 #define NTDDI_VERSION NTDDI_WS03SP1