Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试编写一个可以由 Lazarus 和 Delphi 编译而无需更改的代码。但是为此,需要一个条件语句或类似的东西来检查正在使用哪个编译器。那么是否有任何指令或任何可能知道代码是用 Lazarus 还是 Delphi 编译的?
评论中提供了这个问题的答案,我将在这里复制核心部分:
用于{$IFDEF FPC}检测 FreePascal。
{$IFDEF FPC}