Copy MQ over from hamilton, use SDL2 atomic macros