convert common marcos to inline function