[fpc-pascal] windows.GetProcAddress() vs DynLibs.GetProcAddress()

Michael Van Canneyt michael at freepascal.org
Tue Jan 14 17:07:17 CET 2014



On Tue, 14 Jan 2014, Sven Barth wrote:

> 
> Am 14.01.2014 09:24 schrieb "Sven Barth" <pascaldragon at googlemail.com>:
> > Maybe an overload could be added to load functions by ordinal on Windows and which simply returns Nil on other platforms.
> 
> I've now added an overload which is implemented for the Windows systems and returns Nil on other targets.
> 
> For Delphi compatibility we should maybe also add a PAnsiChar overload for GetProcAddress so that existing code could safely use
> "PAnsiChar(1)".

Definitely not. I don't think we should encourage this.

The dynlibs unit was intended and conceived as a clean, 
cross-platform implementation of dynamic library loading.

It already contains several dubious constructs "for delphi compatibility", 
I don't think we should add another one. I will not remove your addition, 
but adding more is really out of the question.

Delphi compatibility in this case is utter nonsense, 
since Delphi doesn't have a dynlibs unit to begin with.

There are limits to the amount of prostitution I am willing to tolerate.

Michael.



More information about the fpc-pascal mailing list