(Apologies for the title, ran out of ideas )
I'm looking at making a program I'm working on endian-independant. Looking through the search results, the general consensus suggests testing a pointer, but I find that a bit... wasteful.
Think about it: you're compiling the program to run on one specific platform (This isn't Java, and that does everything in big-endian anyway), so rather than actually checking how the platform deals with numbers every time it's run, isn't there some sort of preprocessor definition that would allow me to melt away conversion function calls on platforms that don't need them?
I originally thought that there would be a preprocessor definition you could test for to find out the target platform. So much for good ideas, eh?