Implement ctype functions as safe macros