Convert macro to inline function and move it into .c file.