Conditional Compilation sgcWebSockets

· Instalação

biblioteca sgcWebSockets has um configuração file located em source folder where contains all conditional compilations. This file is sgcVer.inc.

If you abrir this file, você verá there are lots de conditional defines, basically para every Delphi / C++ Builder version, there are um bunch de conditional defines. Por exemplo, para Rad Studio 10.3 there are o following:


{$IFDEF VER330} { Delphi  10.3 }
  {$DEFINE D2006}
  {$DEFINE D2007}
  {$DEFINE D2009}
  {$DEFINE D2010}
  {$DEFINE DXE}
  {$DEFINE DXE2}
  {$DEFINE DXE3}  
  {$DEFINE DXE4} 
  {$DEFINE DXE5} 
  {$DEFINE DXE6} 
  {$DEFINE DXE7} 
  {$DEFINE DXE8} 
  {$DEFINE D10} 
  {$DEFINE D10_1}
  {$DEFINE D10_2}
  {$DEFINE D10_3}
  {$DEFINE INDY10_1}
  {$DEFINE INDY10_2}
  {$DEFINE INDY10_5_5}
  {$DEFINE INDY10_5_7}
  {$DEFINE INDY10_6}
  {$DEFINE INDY10_6_2_5366}
  {$IFNDEF BCB}
    {$IFNDEF MACOS}
    {$IFNDEF ANDROID}
      {.$DEFINE IWIX}
      {.$DEFINE IWXI}
      {.$DEFINE IWXIV}  
    {$ENDIF}
    {$ENDIF}
    {$IFNDEF NEXTGEN}
      {$DEFINE SGC_JSON_INTF}
    {$ENDIF}
  {$ENDIF}
{$ENDIF} 

Compiler Blocks

Primeiro directives are referred para IDE version, each IDE version has his own compiler. Usually it's not recommended para change these.

Em seguida, there are some compilers which apply para Indy version. Por padrão, sgcVer.inc is configured para work com Indy version provided com Rad Studio, but sometimes, is useful update Indy library para versão mais recente. Aqui você pode customize which is your Indy version e comment ou uncomment these compiler directives.

Por fim there are some compiler directives para Intraweb. In fact, Intraweb foi deprecated em later versions e por padrão is not needed, but if you want use Intraweb components, você pode aqui configure which is your Intraweb version.