Fix mac build: explicitly check all platforms inside swapBuffers

Plus some cosmetics

Change-Id: I42d989217a0b40a8a6a03c0ebc6c4aa14b34d387