I suggest to create a bug report in our Issue Tracker and attach HAL code that is causing compile errors. Just looking at your code I don't see anything wrong with it so it likely should be investigated.
I would like to know what BackgroundHALShouldPause does, and how to use it. While it's listed in the HAL Primitives report, it is not used in source code and it doesn't appear in the LMS HAL...