Plan 9 had the distinct advantage of a constant system interface at the source level. X11 did not, but it also made essentially no attempt to abstract it away, so the lines starting #ifdef often outnumbered the actual code. I couldn't make hide nor hair of it, and had no way to reliably test any change.
C with #ifdefs is not portable, it is a collection of 2^n overlaid programs, where n is the number of distinct #if[n]def tags. It's too bad the problems of that approach were not appreciated by the C standard committee, who mandated the #ifndef guard approach that I'm sure could count as a provable billion dollar mistake, probably much more. The cost of building #ifdef'ed code, especially with C++, which decided to be more fine-grained about it, is unfathomable.
Google alone might well count for many millions of dollars in wasted compilation equipment. I remember giving a Plan 9 demo to someone soon after I got to Google. None of the features of the system were of interest. The thing that astounded my audience was the ability to build the kernel on a P90 in 20 seconds or so, and the window system in under 3. At that time, a build of a Google server would require hours on a large distcc cluster.
I still shudder to think of it. It's worse now, of course, far worse, but Google has far larger clusters to handle it and some improvement in tooling. However, the #ifdefs persist.
Tom Cargill warned Bjarne about this around 1984, but the plea fell on deaf ears.
-rob