Enable libffi package on win32,win64 and BSD targets, remove CPU restriction

git-svn-id: trunk@43975 -
This commit is contained in:
pierre 2020-01-18 21:23:21 +00:00
parent 0176697483
commit 367eac9743
3 changed files with 7 additions and 4 deletions

View File

@ -3,7 +3,7 @@ program simple;
uses
ffi;
function WritePChar(s: PChar): LongInt; cdecl;
function WritePChar(s: PChar): LongInt;{$ifdef windows}stdcall;{$else}cdecl;{$endif}
begin
Writeln(s);
WritePChar := StrLen(s);

View File

@ -24,8 +24,7 @@ begin
P.Email := 'libffi-discuss@sourceware.org';
P.Description := 'Headers for the libFFI library (Foreign Function Interface)';
P.NeedLibC:= true; // true for headers that indirectly link to libc?
P.OSes := [linux];
P.CPUs := [x86_64];
P.OSes := [linux,win32,win64] + AllBSDOSes;
P.Dependencies.Add('rtl-objpas');
P.SourcePath.Add('src');

View File

@ -184,7 +184,11 @@ const
FFI_DEFAULT_ABI = ffi_abi(Ord(FFI_SYSV) {$ifdef FREEBSD}or FFI_SYSV_STRUCT_RET{$endif});
{$endif}
{$else}
{$ifdef WIN32}
FFI_DEFAULT_ABI = FFI_STDCALL;
{$else}
FFI_DEFAULT_ABI = FFI_SYSV;
{$endif}
{$endif}
const
@ -216,7 +220,7 @@ const
{$endif}
{$if defined(CPUARM)}
{$if definde(DARWIN)}
{$if defined(DARWIN)}
FFI_TRAMPOLINE_SIZE = 12;
FFI_TRAMPOLINE_CLOSURE_OFFSET = 8;
{$elseif FFI_EXEC_TRAMPOLINE_TABLE}