Check this demo source from the excellent Detour library:
implementation
{$R *.dfm}
var
TrampolineGetMemory: function(Size: NativeInt): Pointer;
cdecl = nil;
Please look at the cdecl = nil;
statement. What does it mean in this context?
Note - I already know that cdecl
stands for a calling convention.
This is just another way to initialize the variable. For example:
program Project1;
{$APPTYPE CONSOLE}
var
i : integer = 5;
begin
WriteLn(i);
ReadLn;
end.
it may be clearer if it was written on one line as
var
TrampolineGetMemory: function(Size: NativeInt): Pointer; cdecl = nil;
Or maybe even better if a type was defined :
type
TTrampolineGetMemory = function(Size: NativeInt): Pointer; cdecl;
//...
var
TrampolineGetMemory: TTrampolineGetMemory = nil;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With