Hacker News new | past | comments | ask | show | jobs | submit login

I remember one C book that described a way to write portable code. There were three phases in the header files: (1) The vendor, (2) The characteristics, (3) a portable layer on the system calls. So the first would define VAX, SUN, etc. The second would use the first section to define LITTLE_ENDIAN, BIG_ENDIAN, HAS_IOCTL, etc. And the third would implement a portable layer on top of the system calls. It was nice to compile because section 1 would often be defined automatically by the pre-processor, and the rest would just be defined properly. No config was needed to compile - you just types "make".

Alas - this was extra work on the developer, and at the time there were a zillion variations, which a developer had to deal with.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: