On this position, maybe 
[code]
#if defined GPIO_PORT_x_BASE 
[/code]
will not be needed, because of straight macro expansion, and if user want to use GPIOG, the error will be readable for him.