bg_lib.c is really just a useless libc function redefinition that causes lots of issues with compiles, I believe that this was to speed up the game but compilers are good enough that it is not necessary..