Swiss 23rd seed and 2016 champion Wawrinka led Djokovic 6-4, 7-5, 2-1 when the Serb quit, having received treatment on his troublesome left shoulder before the start of the third set.
Williams, a six-time US Open winner, romped to a 6-3, 6-4 victory over Croatian 22nd seed Petra Martic to set up a quarter-final with China's Wang Qiang, the conqueror of world number two Barty.
International Motoring Federation (FIA) race director Michael Masi said an investigation into the crash on Saturday that killed Formula Two driver Anthoine Hubert had already begun.
Thapelo Morena is nursing an injury while Darren Keet is finalising his work permit in Belgium, which requires him to stay in that country until all the paperwork is done.