Window creation, for phobos?

Mike Parker via Digitalmars-d digitalmars-d at puremagic.com
Tue Jan 27 17:36:22 PST 2015


On 1/28/2015 7:54 AM, ketmar wrote:
> On Wed, 28 Jan 2015 11:04:55 +1300, Rikki Cattermole wrote:
>
>> First off, Derelict-Util/Derelict-GL3 is a biggy here. Its old code,
>> lets admit it. Its also a standard for loading shared library functions.
>
> please, not Derelict! it's a great work and all that, but it's habit to
> load ALL functions is nasty. not only it is unnecessary, it's sometimes
> just wrong. i recall the problem with DlangUI, where Derelict tries to
> load FreeImage function which is not in my (old) version of the library,
> and DlangUI is not using that function at all. yet DlangUI builds
> successfully and then failed to run until i commented out that function.
>

For several years, Derelict has had a feature I call "selective symbol 
loading" to allow people to load older versions of a library with a 
newer version of Derelict. All they need to do is implement a callback 
that checks the name of a missing function and return a value indicating 
if loading should continue or an exception should be thrown. Very few 
people use it.

After seeing your post about FreeImage in the DLangUI thread a few weeks 
back, I added a new feature to DerelictUtil which automates the 
selective symbol loading. It's now possible to specify a minimum version 
of a library and the loader will not throw an exception if a function is 
missing. It doesn't make sense for some Derelict packages to make use of 
it, but I did add it to the FreeImage loader.

At any rate, I can't automate it fully. There's no way for me to know if 
any given program requires a function that's isn't present in an older 
version of a library or not. Derelict users have to take some 
responsibility in determining the absolute minimum version they need to 
support.


More information about the Digitalmars-d mailing list