some clang/llvm fixes

bonus typecasting
Fixes Mac compatibility with mods build with SDK