title: How to detect specific Delphi builds?
body: <p>This is related to <a href="https://stackoverflow.com/questions/750801/complete-list-of-defines-for-delphi-versions">another Delphi-version question</a> but still different;</p>
  
  <p>I'm looking for a way to detect the service-pack (or build number) of the Delphi compiler  that's compiling my code. The <a href="https://jcl.svn.sourceforge.net/svnroot/jcl/trunk/jcl/source/include/jedi.inc" rel="nofollow noreferrer">jedi.inc</a> is nice, but it doesn't tell me the exact version. (I can't use the SUPPORTS_* defines in there either, as those are version-related too)</p>
  
  <p>I need this, because some bugs are present in older versions (in this case, it's a <a href="http://qc.codegear.com/wc/qcmain.aspx?d=68123" rel="nofollow noreferrer">_ValLong bug in Delphi 2009</a>) that's fixed in a later service-pack (Delphi 2009 service pack 3 in this case).</p>
  
  <p>Currently I have all kinds of checks in my code, like this :</p>
  
  <blockquote>
    <p>{$IFDEF BUG_QC_68123}</p>
  </blockquote>
  
  <p>But I can't just say this in my main include file :</p>
  
  <pre><code>{$IFDEF DELPHI2009_UP}
    {$DEFINE BUG_QC_68123}
  {$ENDIF}
  </code></pre>
  
  <p>...As this would miss the fact that D2009SP3 and later don't have this bug anymore.</p>
  
  <p>Any ideas?</p>
  
  <p>PS: This will probably also apply to older (and newer) versions of Delphi, so any library- and/or component-vendor will have an interest in this too, I presume.</p>