Instead of defining the same set of macros several times, define it once in an appropriate header file. In passing, convert to inline functions.