Just to set the record straight: I am not a developer. I can script bash and perl and even some python with a lot of googling, and I can read C as a five-year old can read Shakespere, but I have definitely no insight in the coding requirements that support for different OSes might pose.
With that said, and based on my very limited understanding, I wrote that “I would have imagined that the only hardware that FA needs to support is the radio, while everything else is abstracted by the kernel” and that “CPU idiosyncracies ought to be taken care of by the compiler”. If I’m out of touch with reality on this in principle, please short-circuit me.
On the other hand I am very much aware of “version tension” between different systems. You want to use libxyz-1.2.3 because is provides some very nifty shortcuts for your code, but it is only available in OS/1 and not in OS/2 or OS/3. That is where I suspect that the ugly conditionals come from: a desire to advance the code where it is possible, while still maintaining it functional where advancement is not possible.
If - and only if - I am correct in that, it seems to me that the appropriate course of action is maintaining only one code base, but different versions for different OSes. As in “code-2.0.1 has been released for RedHat Linux, while code-1.8.53 remains the latest version for Sun Unix and SGI Unix”. In other words you start with something very generic, then you incorporate whatever new stuff you want to in later versions, and you just let the OSes choose whether and when they want to enable your newer versions, or stay with your older ones.