Inline macro was changed to a more liberate implementation. Port is a bit simplified.