3 ms·
The whole of Plan9 is written like that. If you look here http://plan9.bell-labs.com/sources/plan9/sys/src/9/ http://plan9.bell-labs.com/sources/plan9/sys/src/
by SixSigma 12y ago
The whole of Plan9 is written like that.
If you look here http://plan9.bell-labs.com/sources/plan9/sys/src/9/ http://plan9.bell-labs.com/sources/plan9/sys/src/9/
You can see that port & boot are the portable code. Each architecture can fall back on that less optimised code should it need to.
Then each of the directories: bcm, kw, mtx, omap, pc, pcboot, ppc, rb, teg
have platform specific c files
This greatly eases porting to a new architecture and also means cross compilation is significantly easier.
#ifdefs are rare in the source code and other pragmas are few and far between.
Conditional compilation is the enemy of readable code.
- sitkack 12y agoMoving and re-moving conditionals is our life. Is there a name for that structure? Polymorphic portability.