Improve portability for shift and rotate macros.