Writing Efficient and Portable Macros