[fpc-pascal] How to do conditional compilation with macros

Reinier Olislagers reinierolislagers at gmail.com
Sun Sep 18 13:59:33 CEST 2011

On 18-9-2011 13:41, Sven Barth wrote:
> On 18.09.2011 13:29, Reinier Olislagers wrote:
>> What am I doing wrong?
> Additionally to what Marco wrote:
> You must not use the "$" as prefix for the "variable" if you reference
> such a compiler define inside an $if or $ifdef.
> Regards,
> Sven

Thanks guys - reading manuals is not always my strong point ;)

This works:
program conditional;

{$mode objfpc}{$H+}

  //apparently FPC_FULLVERSION was introduced
  //in FPC 2.2.4 though...
  writeln('Version newer than 2.2');

More information about the fpc-pascal mailing list