* Dotted filenames for package libvlc

This commit is contained in:
Michaël Van Canneyt 2023-03-06 14:58:05 +01:00
parent dc88694c7f
commit ff4c0ecd90
5 changed files with 34 additions and 1 deletions

View File

@ -0,0 +1,3 @@
unit Api.Vlc.Component;
{$DEFINE FPC_DOTTEDUNITS}
{$i vlc.pp}

View File

@ -0,0 +1,3 @@
unit Api.Vlc;
{$DEFINE FPC_DOTTEDUNITS}
{$i libvlc.pp}

View File

@ -0,0 +1,4 @@
src/libvlc.pp=namespaced/Api.Vlc.pp
{s*:src/}=namespaced/
{i+:src/}
src/vlc.pp=namespaced/Api.Vlc.Component.pp

View File

@ -16,11 +16,18 @@
**********************************************************************} **********************************************************************}
{$mode objfpc} {$mode objfpc}
{$IFNDEF FPC_DOTTEDUNITS}
unit libvlc; unit libvlc;
{$ENDIF FPC_DOTTEDUNITS}
interface interface
{$IFDEF FPC_DOTTEDUNITS}
uses
System.CTypes;
{$ELSE FPC_DOTTEDUNITS}
uses uses
ctypes; ctypes;
{$ENDIF FPC_DOTTEDUNITS}
{$IFDEF FPC} {$IFDEF FPC}
{$PACKRECORDS C} {$PACKRECORDS C}
@ -627,12 +634,21 @@ function GetVLCLibPath: String;
implementation implementation
{$IFDEF FPC_DOTTEDUNITS}
uses
System.SysUtils,
{$IFDEF Windows}
WinApi.Windows,
{$ENDIF}
System.DynLibs;
{$ELSE FPC_DOTTEDUNITS}
uses uses
SysUtils, SysUtils,
{$IFDEF WINDOWS} {$IFDEF WINDOWS}
windows, windows,
{$ENDIF} {$ENDIF}
dynlibs; dynlibs;
{$ENDIF FPC_DOTTEDUNITS}
var var
hlib : tlibhandle; hlib : tlibhandle;
@ -929,7 +945,7 @@ Procedure Loadlibvlc(lib : AnsiString; CheckProcNames : Boolean = False);
Function GetProcAddress(h : TLibHandle; Name : AnsiString) : Pointer; Function GetProcAddress(h : TLibHandle; Name : AnsiString) : Pointer;
begin begin
Result:=dynlibs.GetProcAddress(h,Name); Result:={$IFDEF FPC_DOTTEDUNITS}System.{$ENDIF}DynLibs.GetProcAddress(h,Name);
If (Result=Nil) and CheckProcNames then If (Result=Nil) and CheckProcNames then
raise Exception.CreateFmt('Could not find procedure address: %s ',[Name]); raise Exception.CreateFmt('Could not find procedure address: %s ',[Name]);
end; end;

View File

@ -12,14 +12,21 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
**********************************************************************} **********************************************************************}
{$IFNDEF FPC_DOTTEDUNITS}
unit vlc; unit vlc;
{$ENDIF FPC_DOTTEDUNITS}
{$mode objfpc}{$H+} {$mode objfpc}{$H+}
interface interface
{$IFDEF FPC_DOTTEDUNITS}
uses
System.Classes, System.SysUtils, System.CTypes, Api.Vlc, System.SyncObjs;
{$ELSE FPC_DOTTEDUNITS}
uses uses
Classes, SysUtils, ctypes, libvlc, syncobjs; Classes, SysUtils, ctypes, libvlc, syncobjs;
{$ENDIF FPC_DOTTEDUNITS}
Type Type