Moving ifdef inside the function