From 535cc36d279d45221dcbdbc5f5264a666ba6323c Mon Sep 17 00:00:00 2001 From: Sun Serega Date: Fri, 12 Jan 2024 21:21:37 +0200 Subject: [PATCH] Release-only [SuppressUnmanagedCodeSecurity] --- Packing/Template/LowLvl/CodeContainerItems.pas | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Packing/Template/LowLvl/CodeContainerItems.pas b/Packing/Template/LowLvl/CodeContainerItems.pas index 774ff8e0..e3fe9da9 100644 --- a/Packing/Template/LowLvl/CodeContainerItems.pas +++ b/Packing/Template/LowLvl/CodeContainerItems.pas @@ -2349,8 +2349,10 @@ RequiredList = record {$region WriteAPI} var WriteAPI := procedure(api_funcs: sequence of Func; add_ver, depr_ver: Func->string)-> begin - intr_wr += ' [PCUNotRestore]'#10; + intr_wr += ' {$ifndef DEBUG}'#10; intr_wr += ' [System.Security.SuppressUnmanagedCodeSecurity]'#10; + intr_wr += ' {$endif DEBUG}'#10; + intr_wr += ' [PCUNotRestore]'#10; intr_wr += ' ///'#10; intr_wr += ' '; intr_wr += api; @@ -2533,8 +2535,10 @@ impl_wr += class_type; if any_funcs then begin - intr_wr += ' [PCUNotRestore]'#10; + intr_wr += ' {$ifndef DEBUG}'#10; intr_wr += ' [System.Security.SuppressUnmanagedCodeSecurity]'#10; + intr_wr += ' {$endif DEBUG}'#10; + intr_wr += ' [PCUNotRestore]'#10; end; intr_wr += ' ///'#10;