Helper macros for GCD