[fpc-pascal] Mangle name in fpc-FreeBSD ?
Marc Santhoff
M.Santhoff at web.de
Sun Mar 20 18:16:54 CET 2016
On So, 2016-03-20 at 09:47 -0700, fredvs wrote:
> Re-hello.
>
> To resume.
>
> Here what is working perfectly for me:
>
> {$IF DEFINED(freebsd)}
> ...
> var
> ap1 : pointer;
> begin
> ap1 := dlopen(Pchar(mp4ff), 1);
> Pointer(mp4ff_open_read) := dlsym(ap1, pchar('mp4ff_open_read'));
> ...
> {$else}
> ...
> var
> an1 : integer;
> begin
> an1 := DynLibs.SafeLoadLibrary(PChar(mp4ff));
> Pointer(mp4ff_open_read) := GetProcAddress(an1,
> pchar('mp4ff_open_read'));
> ...
> {$endif}
That's totally OK, but the unit dynlibs is written for platform
independence and I'd like to be able to use it on FreeBSD and at least
Windows without having much $ifdefs and the like.
Have fun,
Marc
--
Marc Santhoff <M.Santhoff at web.de>
More information about the fpc-pascal
mailing list