Win32: move main macro to a function