Use macros for depreacated function attributes

This will help porting on compilers that don't support it