Felipe
Felipe

Reputation: 283

Knowing if the code is compiled using Lazarus or Delphi

I am trying to have a code which can be possible to be compiled by Lazarus and Delphi without changing it. But for that it would be necessary a conditional statement or something similar to check which compiler is being used. So is there any directive or anything that is possible to know if a code is being compiled with Lazarus or Delphi?

Upvotes: 2

Views: 623

Answers (1)

Paul-Jan
Paul-Jan

Reputation: 17278

The answer to this question was provided in the comments, I'll just copy the core bit here:

Use {$IFDEF FPC} to detect FreePascal.

Upvotes: 3

Related Questions