@fst the biggest explanation is C. But sure, there are quite a number of #ifdefs and more to make sure it works on as much as possible.
Also: many of the ports to these different OSes were never contributed back to us so I don't actually know how much extra patching that was necessary. Or not.