Fail to compile 313.18 for kernel version 3.8.0-rc3

I was unable to install the 313.18 driver with the 3.8.0-rc3 kernel compiled from git source. It failed in conftest prior to building the kernel module.

I was able to unpack NVIDIA-Linux-x86-313.18.run and build the kernel module manually after applying a small patch attached.

That can’t be all. How did you trick conftest to actually detect the kernel and
work around all the missing includes? So far I haven’t been able to build 313.18 for
3.8-rc and even for 3.7 I need to patch it.

Nevermind, I figured a way around it.