Add ifdefs to fix build on older kernel header versions.