Handmade Hero»Forums»Code
Kim
Kim Jørgensen
64 posts
Handmade Intrinsics MSVC Specific
Hi Casey

Would it be possible to add "#if COMPILER_MSVC" to the _rotl and _rotr calls and add an alternative implementation:

1
uint32 Result = (Value << Amount) | (Value >> (32 - Amount));

or
1
uint32 Result = (Value >> Amount) | (Value << (32 - Amount));


That would help us who are using a non MSVC compiler.

/Kim
Mike Oldham
6 posts
Handmade Intrinsics MSVC Specific
I would love to second this. I just threw the latest code in and my code errors here as well. I can work around it with Kim's example of course, but I do like to be able to just drop all of Casey's code into my project and run without having to touch any of his code.

Thanks
Casey Muratori
801 posts / 1 project
Casey Muratori is a programmer at Molly Rocket on the game 1935 and is the host of the educational programming series Handmade Hero.
Handmade Intrinsics MSVC Specific
Roger that - we'll try to take care of this on Monday's stream. Somebody remind me in the Q&A :)

- Casey
Casey Muratori
801 posts / 1 project
Casey Muratori is a programmer at Molly Rocket on the game 1935 and is the host of the educational programming series Handmade Hero.
Handmade Intrinsics MSVC Specific
Should be fixed now, hopefully! Can somebody check?

- Casey
Kim
Kim Jørgensen
64 posts
Handmade Intrinsics MSVC Specific
It builds and works fine.
Thank you :-)

/Kim