From ff4c0ecd900126c1d8c69d00110d309a3766b507 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Van=20Canneyt?= Date: Mon, 6 Mar 2023 14:58:05 +0100 Subject: [PATCH] * Dotted filenames for package libvlc --- .../libvlc/namespaced/Api.Vlc.Component.pp | 3 +++ packages/libvlc/namespaced/Api.Vlc.pp | 3 +++ packages/libvlc/namespaces.lst | 4 ++++ packages/libvlc/src/libvlc.pp | 18 +++++++++++++++++- packages/libvlc/src/vlc.pp | 7 +++++++ 5 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 packages/libvlc/namespaced/Api.Vlc.Component.pp create mode 100644 packages/libvlc/namespaced/Api.Vlc.pp create mode 100644 packages/libvlc/namespaces.lst diff --git a/packages/libvlc/namespaced/Api.Vlc.Component.pp b/packages/libvlc/namespaced/Api.Vlc.Component.pp new file mode 100644 index 0000000000..60907cdea1 --- /dev/null +++ b/packages/libvlc/namespaced/Api.Vlc.Component.pp @@ -0,0 +1,3 @@ +unit Api.Vlc.Component; +{$DEFINE FPC_DOTTEDUNITS} +{$i vlc.pp} diff --git a/packages/libvlc/namespaced/Api.Vlc.pp b/packages/libvlc/namespaced/Api.Vlc.pp new file mode 100644 index 0000000000..41a5b649f5 --- /dev/null +++ b/packages/libvlc/namespaced/Api.Vlc.pp @@ -0,0 +1,3 @@ +unit Api.Vlc; +{$DEFINE FPC_DOTTEDUNITS} +{$i libvlc.pp} diff --git a/packages/libvlc/namespaces.lst b/packages/libvlc/namespaces.lst new file mode 100644 index 0000000000..58f1d1c20f --- /dev/null +++ b/packages/libvlc/namespaces.lst @@ -0,0 +1,4 @@ +src/libvlc.pp=namespaced/Api.Vlc.pp +{s*:src/}=namespaced/ +{i+:src/} +src/vlc.pp=namespaced/Api.Vlc.Component.pp diff --git a/packages/libvlc/src/libvlc.pp b/packages/libvlc/src/libvlc.pp index 525e1b7c26..e37aa0ecf8 100644 --- a/packages/libvlc/src/libvlc.pp +++ b/packages/libvlc/src/libvlc.pp @@ -16,11 +16,18 @@ **********************************************************************} {$mode objfpc} +{$IFNDEF FPC_DOTTEDUNITS} unit libvlc; +{$ENDIF FPC_DOTTEDUNITS} interface +{$IFDEF FPC_DOTTEDUNITS} +uses + System.CTypes; +{$ELSE FPC_DOTTEDUNITS} uses ctypes; +{$ENDIF FPC_DOTTEDUNITS} {$IFDEF FPC} {$PACKRECORDS C} @@ -627,12 +634,21 @@ function GetVLCLibPath: String; implementation +{$IFDEF FPC_DOTTEDUNITS} +uses + System.SysUtils, + {$IFDEF Windows} + WinApi.Windows, + {$ENDIF} + System.DynLibs; +{$ELSE FPC_DOTTEDUNITS} uses SysUtils, {$IFDEF WINDOWS} windows, {$ENDIF} dynlibs; +{$ENDIF FPC_DOTTEDUNITS} var hlib : tlibhandle; @@ -929,7 +945,7 @@ Procedure Loadlibvlc(lib : AnsiString; CheckProcNames : Boolean = False); Function GetProcAddress(h : TLibHandle; Name : AnsiString) : Pointer; begin - Result:=dynlibs.GetProcAddress(h,Name); + Result:={$IFDEF FPC_DOTTEDUNITS}System.{$ENDIF}DynLibs.GetProcAddress(h,Name); If (Result=Nil) and CheckProcNames then raise Exception.CreateFmt('Could not find procedure address: %s ',[Name]); end; diff --git a/packages/libvlc/src/vlc.pp b/packages/libvlc/src/vlc.pp index 9c32ef0031..5d1474660d 100644 --- a/packages/libvlc/src/vlc.pp +++ b/packages/libvlc/src/vlc.pp @@ -12,14 +12,21 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. **********************************************************************} +{$IFNDEF FPC_DOTTEDUNITS} unit vlc; +{$ENDIF FPC_DOTTEDUNITS} {$mode objfpc}{$H+} interface +{$IFDEF FPC_DOTTEDUNITS} +uses + System.Classes, System.SysUtils, System.CTypes, Api.Vlc, System.SyncObjs; +{$ELSE FPC_DOTTEDUNITS} uses Classes, SysUtils, ctypes, libvlc, syncobjs; +{$ENDIF FPC_DOTTEDUNITS} Type