[macros] use an implementation that is better confirmed to the standard