Want to write architecture specific code in
C language, precisely for GCC, and doesn’t how to separate architecture specific code, hmmm… Below is the hint:
[abbe@chateau-d-lf: ~]$ echo | gcc -E -dM -
It will list all the preprocessor defines defined by your GCC. So, you’ve to just figure out your target architecture’s preprocessor define. To compile code for 32 bit architecture from a non 32-bit architecture (say, a 64bit architecture, or a 128-bit architecure :) ), use
-m32 switch of GCC. Here is the corresponding thread from gnu.gcc.help USENET group.