This mostly involves adding some missing includes, but I also had to disable some things that xcode doesn't seem to support.