title: How to distinguish ERTS versions at pre-processing time?
body: <p>In the recent Erlang R14, inets' file <code>httpd.hrl</code> has been moved from:</p>
  
  <pre><code>src/httpd.hrl
  </code></pre>
  
  <p>to:</p>
  
  <pre><code>src/http_server/httpd.hrl
  </code></pre>
  
  <p>The <a href="http://www.erlang-web.org" rel="nofollow">Erlang Web</a> framework includes the file in several places using the following directive:</p>
  
  <pre><code>-include_lib("inets/src/httpd.hrl").
  </code></pre>
  
  <p>Since I'd love the Erlang Web to compile with <em>both</em> versions of Erlang (R13 and R14), what I'd need ideally is:</p>
  
  <pre><code>-ifdef(OLD_ERTS_VERSION).
  -include_lib("inets/src/httpd.hrl").
  -else.
  -include_lib("inets/src/http_server/httpd.hrl").
  -endif.
  </code></pre>
  
  <p>Even if it possible to retrieve the ERTS version via:</p>
  
  <pre><code>erlang:system_info(version).
  </code></pre>
  
  <p>That's indeed not possible at pre-processing time.</p>
  
  <p>How to deal with these situations? Is the parse transform the only way to go? Are there better alternatives?</p>