emacs-devel
[Top][All Lists]
Advanced

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

Removing the usage of X structures (or their names) in independent code


From: Alex Gramiak
Subject: Removing the usage of X structures (or their names) in independent code
Date: Wed, 08 May 2019 22:28:23 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)

Numerous internal procedures in Emacs that aren't tied to X expect and
use structures with the same name as X structures: e.g., XColor,
XGCValues, GC, XRectangle, XChar2b, Display, Pixmap, Cursor.

This poses an issue when attempting to use a non-X backend to Emacs that
conditionally uses X itself: name clashes occur between the structures
intended for use in the independent Emacs code and the internal X
structures. Workarounds using the preprocessor exist but are ugly and
fragile.

What would be the preferred way to fix this situation? Two options are
to use typedefs for these structures like XImagePtr_or_DC, or to use
unions. Everything else being equal, I would prefer the union approach.

Alternatively, for structures like XColor, there could be new generic
structures that all the backends share, but that would involve some
overhead on the X side for conversion.



reply via email to

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