emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Interest in nt_load_image?


From: Eli Zaretskii
Subject: Re: Interest in nt_load_image?
Date: Tue, 31 Mar 2020 16:31:00 +0300

> From: Juan José García-Ripoll
>  <address@hidden>
> Date: Tue, 31 Mar 2020 10:01:46 +0200
> 
> I have build GDI+ as a built-in back-end with which to compile Emacs. An
> Emacs built with GDI+ requires UTF-16 support and thus will not run on
> Windows 98, but it will run on Windows XP on later. GDI+ support is
> optional because it can be selected at build time, not because it can be
> chosen at compilation time.

The problem with such selection of features at build time is that the
resulting binary will flatly refuse to start on systems where the
optional functionality (in this case, GDI+) is not available, even if
there's no call at runtime to any of the optional functions.  Windows
refuses to run a program which has a function in its import table that
cannot be found in the shared libraries against which the program was
linked, or if the program was linked against a shared library that is
not available on the target system.  And on Windows we frequently see
that people are using binaries someone else compiled, so we cannot
rely on the end-user to build Emacs according to what will be
available on the end-user's system.

That is why we never link Emacs on Windows against any optional
libraries, but instead load them at runtime when the corresponding
feature is first requested.  The features whose DLL couldn't be
loaded, or where the DLL doesn't have the required functions -- those
features will not become available, but at least Emacs will start and
allow you to use it for other jobs.

In the case of GDI+, I'm quite sure we will want to have runtime
control on whether it is used even if available, at least initially,
until it becomes the default (if it ever does).  This is good for
maintenance (debugging problems people report), if nothing else.  I
could even envision users who'd prefer libpng etc. for some other
reason, whether technical or otherwise.

Therefore, catering to systems without GDI+ is very simple: the
respective variable(s) should be set up at startup to indicate that
GDI+ shouldn't be used.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]