Use the easy way that rizzo mentioned, only include malloc.h on the Windows platform.