I'm very new to C#, but what if you created a generic function like this:
uint RolRight(uint x, byte y, byte b) // number, shift, bits
{
//#define ROTR(x,y,b) (((x)>>(y&((b)-1))) | ((x)<<((b)-(y&((b)-1)))))
return (x >> (y & (b - 1))) | (x << (b - (y & (b - 1))));
}
And called it like one of these:
byte Ret = (byte)RolRight(0x81, 1, 8);
ushort Ret = (ushort)RolRight(0x8001, 1, 16);
uint Ret = RolRight(0x80000001, 1, 32);