mirror of
https://github.com/reactos/reactos.git
synced 2025-07-03 01:51:20 +00:00
[UCRT] Import Microsoft.Windows.SDK.CRTSource version 10.0.22621.3
Imported from https://www.nuget.org/packages/Microsoft.Windows.SDK.CRTSource/10.0.22621.3 License: MIT
This commit is contained in:
parent
f1b60c66f0
commit
04e0dc4a7a
568 changed files with 115483 additions and 0 deletions
45
sdk/lib/ucrt/stdlib/rotl.cpp
Normal file
45
sdk/lib/ucrt/stdlib/rotl.cpp
Normal file
|
@ -0,0 +1,45 @@
|
|||
//
|
||||
// rotl.cpp
|
||||
//
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
//
|
||||
// Defines _lrotl(), _rotl(), and _rotl64(), which perform a rotate-left on an
|
||||
// integer.
|
||||
//
|
||||
#include <stdlib.h>
|
||||
#include <limits.h>
|
||||
|
||||
|
||||
|
||||
#pragma function(_lrotl, _rotl, _rotl64)
|
||||
|
||||
#if UINT_MAX != 0xffffffff
|
||||
#error This source file assumes 32-bit integers
|
||||
#endif
|
||||
|
||||
#if UINT_MAX != ULONG_MAX
|
||||
#error This source file assumes sizeof(int) == sizeof(long)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
extern "C" unsigned long __cdecl _lrotl(unsigned long value, int shift)
|
||||
{
|
||||
shift &= 0x1f;
|
||||
value = (value >> (0x20 - shift)) | (value << shift);
|
||||
return value;
|
||||
}
|
||||
|
||||
extern "C" unsigned __cdecl _rotl(unsigned value, int shift)
|
||||
{
|
||||
shift &= 0x1f;
|
||||
value = (value >> (0x20 - shift)) | (value << shift);
|
||||
return value;
|
||||
}
|
||||
|
||||
extern "C" unsigned __int64 __cdecl _rotl64(unsigned __int64 value, int shift)
|
||||
{
|
||||
shift &= 0x3f;
|
||||
value = (value >> (0x40 - shift)) | (value << shift);
|
||||
return value;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue