Fixed build for *nix and added functions to platform-nix.c