title: Is it a bad practice to use #ifdef in code?
body: <p>I have to use lot of #ifdef <strong>i386</strong> and <strong>x86_64</strong> for architecture specific code and some times #ifdef MAC or #ifdef WIN32... so on for platform specific code.</p>
  
  <p>We have to keep the common code base and portable.</p>
  
  <p>But we have to follow the guideline that use of #ifdef is strict no. I dont understand why?</p>
  
  <p>As a extension to this question I would also like to understand when to use #ifdef ?</p>
  
  <p>For example, dlopen() cannot open 32 bit binary while running from 64 bit process and vice versa. Thus its more architecture specific. Can we use #ifdef in such situation?</p>