Fix build with deprecated API disabled

2 jobs for master in 4 minutes and 51 seconds (queued for 9 minutes and 29 seconds)