SQLite (with external DLL) works only with 'double word' compiler alignment
Posted: Thu 04 Jul 2019 08:54
Hello!
User-defined functions works only when I set Record field alignment option in 'Double word'. If I use Byte or Word, function call give AV error (Delphi, UniDac with source).
You should use implicit compiler directive in LiteCallUni.pas:
or change record definition as:
(see option "packed" in the record header, and padding1-padding3 in record definition).
Thank you.
User-defined functions works only when I set Record field alignment option in 'Double word'. If I use Byte or Word, function call give AV error (Delphi, UniDac with source).
You should use implicit compiler directive in LiteCallUni.pas:
Code: Select all
{$A4}
Code: Select all
unit LiteCallUni;
...
pFuncDef3250 = ^TFuncDef3250;
TFuncDef3250 = packed record
nArg: i8; // Number of arguments. -1 means unlimited */
padding1: i8;
padding2: i8;
padding3: i8;
funcFlags: u32; // Some combination of SQLITE_FUNC_* */
pUserData: IntPtr; // User data parameter */
end;
Thank you.