SQLite (with external DLL) works only with 'double word' compiler alignment

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Tarifer
Posts: 26
Joined: Thu 26 May 2011 08:13

SQLite (with external DLL) works only with 'double word' compiler alignment

Post by Tarifer » 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:

Code: Select all

{$A4}
or change record definition as:

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;
(see option "packed" in the record header, and padding1-padding3 in record definition).

Thank you.

MaximG
Devart Team
Posts: 1375
Joined: Mon 06 Jul 2015 11:34

Re: SQLite (with external DLL) works only with 'double word' compiler alignment

Post by MaximG » Thu 04 Jul 2019 13:19

Thank you for the information. We have reproduced the issue and will investigate its origin. We will inform you about the results shortly.

MaximG
Devart Team
Posts: 1375
Joined: Mon 06 Jul 2015 11:34

Re: SQLite (with external DLL) works only with 'double word' compiler alignment

Post by MaximG » Fri 19 Jul 2019 11:22

We've reproduced the issue and fixed it. The fix will be included in the new UniDAC build, which we're planning to release next week.

Post Reply