[Issue 9925] New: Fix some compilation issues around usage of #if and #ifdef