Delphi #IF(DEBUG) equivalent?

后端 未结 4 1755
轮回少年
轮回少年 2021-02-05 07:27

Is there a Delphi equivalent of the C# #if(DEBUG) compiler directive?

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-05 08:03

    DebugHook is set if an application is running under the IDE debugger. Not the same as a compiler directive but still pretty useful. For example:

    ReportMemoryLeaksOnShutdown := DebugHook <> 0; // show memory leaks when debugging
    

提交回复
热议问题