Changed SM_GetState to macro