build fixes
fix macros
integrated srwlock kernel from APC