My apologies for the continued rant, but I had another thought to share.  ;)

On Sun, Sep 5, 2010 at 2:31 PM, DZ-Jay <d...@caribe.net> wrote:
> Since a new compiler is an absolute unknown factor, it cannot be assumed to 
> be supported by default.

If the only objection to using CompilerVersion is to avoid implying
support for unknown compilers, there could be an additional check
(current minimum version check included for context):

{$IFNDEF COMPILER7_UP}
   Bomb('This component requires Delphi 7 or later');
{$ENDIF}

// Using CompilerVersion checks, all future compilers would
automatically have COMPILER7_UP defined.
// So add an additional check for compilers higher than the currently
supported version.
{$IF CompilerVersion >= 22.0}
  Bomb('This version of Delphi is not yet supported');
{$IFEND}

Of course, I'd prefer such a check to be in the .inc file, so that it
would be easy to update (and disabled, if so desired).

Updating the .inc file for Delphi XE would involve:
1) updating the maximum version check above
2) adding 16 lines to the .INC:

{$IF CompilerVersion = 22.0}
  {$DEFINE COMPILER15}
  {$IFDEF BCB}
    {$DEFINE BCB15}
  {$ELSE}
    {$DEFINE DELPHI15}
  {$ENDIF}
{$IFEND}

{$IF CompilerVersion >= 22.0}
  {$DEFINE COMPILER15_UP}
  {$IFDEF BCB}
    {$DEFINE BCB15_UP}
  {$ELSE}
    {$DEFINE DELPHI15_UP}
  {$ENDIF}
{$IFEND}

Compared to the these 53 lines (which continually grow with each new version):

{$IFDEF VER220}
  {$DEFINE COMPILER15}
  {$IFDEF BCB}
    {$DEFINE BCB15}
  {$ELSE}
    {$DEFINE DELPHI15}
    {$DEFINE DELPHI}
  {$ENDIF}
{$ENDIF}

{$IFDEF DELPHI15}
  {$DEFINE DELPHI15_UP}
  {$DEFINE DELPHI14_UP}
  {$DEFINE DELPHI12_UP}
  {$DEFINE DELPHI11_UP}
  {$DEFINE DELPHI10_UP}
  {$DEFINE DELPHI9_UP}
  {$DEFINE DELPHI7_UP}
  {$DEFINE DELPHI6_UP}
  {$DEFINE DELPHI5_UP}
  {$DEFINE DELPHI4_UP}
  {$DEFINE DELPHI3_UP}
  {$DEFINE DELPHI2_UP}
  {$DEFINE DELPHI1_UP}
{$ENDIF}

{$IFDEF COMPILER15}
  {$DEFINE COMPILER15_UP}
  {$DEFINE COMPILER14_UP}
  {$DEFINE COMPILER12_UP}
  {$DEFINE COMPILER11_UP}
  {$DEFINE COMPILER10_UP}
  {$DEFINE COMPILER9_UP}
  {$DEFINE COMPILER7_UP}
  {$DEFINE COMPILER6_UP}
  {$DEFINE COMPILER5_UP}
  {$DEFINE COMPILER4_UP}
  {$DEFINE COMPILER35_UP}
  {$DEFINE COMPILER3_UP}
  {$DEFINE COMPILER2_UP}
  {$DEFINE COMPILER1_UP}
{$ENDIF}

{$IFDEF BCB15}
  {$DEFINE BCB15_UP}
  {$DEFINE BCB14_UP}
  {$DEFINE BCB12_UP}
  {$DEFINE BCB11_UP}
  {$DEFINE BCB10_UP}
  {$DEFINE BCB7_UP}
  {$DEFINE BCB6_UP}
  {$DEFINE BCB5_UP}
  {$DEFINE BCB4_UP}
  {$DEFINE BCB3_UP}
  {$DEFINE BCB1_UP}
{$ENDIF}

I think CompilerVersion is the better method.  But, then again, maybe
I don't know what I'm talking about.  :(

Jon
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to