Re: [fpc-devel] GetDiskFreeSpaceExW implementation

2025-11-25 Thread Bart via fpc-devel
On Wed, Nov 26, 2025 at 12:16 AM Tomas Hajny via fpc-devel wrote: > I'd guess that Delphi compatibility is the answer to both questions > (https://docwiki.embarcadero.com/Libraries/Sydney/en/System.SysUtils.GetDiskFreeSpaceEx). > Possibly due to Delphi not having 64-bit unsigned integer at some

Re: [fpc-devel] GetDiskFreeSpaceExW implementation

2025-11-25 Thread Tomas Hajny via fpc-devel
On 2025-11-25 23:27, Bart via fpc-devel wrote: Hi Bart, MS defines GetDiskFreeSpaceExW as follows: (https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getdiskfreespaceexw) BOOL GetDiskFreeSpaceExW( [in, optional] LPCWSTR lpDirectoryName, [out, optional] PULARG

Re: [fpc-devel] Impossible CONST generic constraints in forward declarations...?

2025-11-25 Thread Martin Frb via fpc-devel
On 25/11/2025 23:01, Martin Frb via fpc-devel wrote: On 25/11/2025 22:02, Martin Frb via fpc-devel wrote: On 25/11/2025 20:41, Martin Frb via fpc-devel wrote: According to https://forum.lazarus.freepascal.org/index.php/topic,52157.msg383991.html#msg383991 2) Constraints in a "forward" decla

[fpc-devel] GetDiskFreeSpaceExW implementation

2025-11-25 Thread Bart via fpc-devel
Hi, MS defines GetDiskFreeSpaceExW as follows: (https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getdiskfreespaceexw) BOOL GetDiskFreeSpaceExW( [in, optional] LPCWSTR lpDirectoryName, [out, optional] PULARGE_INTEGER lpFreeBytesAvailableToCaller, [out, optional

Re: [fpc-devel] Impossible CONST generic constraints in forward declarations...?

2025-11-25 Thread Martin Frb via fpc-devel
On 25/11/2025 22:02, Martin Frb via fpc-devel wrote: On 25/11/2025 20:41, Martin Frb via fpc-devel wrote: According to https://forum.lazarus.freepascal.org/index.php/topic,52157.msg383991.html#msg383991 2) Constraints in a "forward" declaration in the implementation (or a program?) must be

Re: [fpc-devel] Impossible CONST generic constraints in forward declarations...?

2025-11-25 Thread Martin Frb via fpc-devel
On 25/11/2025 20:41, Martin Frb via fpc-devel wrote: According to https://forum.lazarus.freepascal.org/index.php/topic,52157.msg383991.html#msg383991 2) Constraints in a "forward" declaration in the implementation (or a program?) must be kept. Actually, that does not seem to be true either

[fpc-devel] Impossible CONST generic constraints in forward declarations...?

2025-11-25 Thread Martin Frb via fpc-devel
According to https://forum.lazarus.freepascal.org/index.php/topic,52157.msg383991.html#msg383991 1) Contstraint given in the interface declaration MUST be dropped in the implementation  (though it does not explicitly mention methods in a class in the interface or implementation) 2) Constra

Re: [fpc-devel] generics defy scoping rules -- Intended?

2025-11-25 Thread Sven Barth via fpc-devel
Martin Frb via fpc-devel schrieb am Di., 25. Nov. 2025, 17:29: > On 25/11/2025 16:14, Hairy Pixels via fpc-devel wrote: > > On Nov 25, 2025 at 9:55:46 PM, Martin Frb via fpc-devel < > [email protected]> wrote: > >> Thanks, which just for confirmation brings up a follow up question. (

Re: [fpc-devel] generics defy scoping rules -- Intended?

2025-11-25 Thread Sven Barth via fpc-devel
Martin Frb via fpc-devel schrieb am Di., 25. Nov. 2025, 15:55: > On 25/11/2025 14:19, Sven Barth via fpc-devel wrote: > > > > Yes, because in fact they don't have the same name. The name of a generic > with a single parameter is essentially "TFoo<>" while that of a generic > with two parameters i

Re: [fpc-devel] generics defy scoping rules -- Intended?

2025-11-25 Thread Martin Frb via fpc-devel
On 25/11/2025 16:14, Hairy Pixels via fpc-devel wrote: On Nov 25, 2025 at 9:55:46 PM, Martin Frb via fpc-devel wrote: Thanks, which just for confirmation brings up a follow up question. (I haven't used generic function much yet, so maybe I miss something)           function  Foo   (aParam: In

Re: [fpc-devel] generics defy scoping rules -- Intended?

2025-11-25 Thread Hairy Pixels via fpc-devel
On Nov 25, 2025 at 9:55:46 PM, Martin Frb via fpc-devel < [email protected]> wrote: > Thanks, which just for confirmation brings up a follow up question. (I > haven't used generic function much yet, so maybe I miss something) > > function Foo (aParam: Integer): integer;

Re: [fpc-devel] generics defy scoping rules -- Intended?

2025-11-25 Thread Martin Frb via fpc-devel
On 25/11/2025 14:19, Sven Barth via fpc-devel wrote: Yes, because in fact they don't have the same name. The name of a generic with a single parameter is essentially "TFoo<>" while that of a generic with two parameters is "TFoo<,>". The amount of generic parameters is part of the type or ro

Re: [fpc-devel] generics defy scoping rules -- Intended?

2025-11-25 Thread Hairy Pixels via fpc-devel
On Nov 25, 2025 at 4:48:52 PM, Michael Van Canneyt via fpc-devel < [email protected]> wrote: > Delphi allows to overload a generic with a non-generic class. > > TFoo = class end; > TFoo = class F: a end; > > FPC has experimental support for this as far as I know. > > So the answer w

Re: [fpc-devel] generics defy scoping rules -- Intended?

2025-11-25 Thread Sven Barth via fpc-devel
Martin Frb via fpc-devel schrieb am Mo., 24. Nov. 2025, 21:30: > Normally, if I refer to a type then the first type found by the name > will be taken => and if that type is not compatible, then I get an error. > => See Example 2 > > But, if I try to specialize a generic, and some other type by th

Re: [fpc-devel] generics defy scoping rules -- Intended?

2025-11-25 Thread Michael Van Canneyt via fpc-devel
On Mon, 24 Nov 2025, Martin Frb via fpc-devel wrote: Normally, if I refer to a type then the first type found by the name will be taken => and if that type is not compatible, then I get an error. => See Example 2 But, if I try to specialize a generic, and some other type by the same name ex