unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Removing the usage of X structures (or their names) in independent code
@ 2019-05-09  4:28 Alex Gramiak
  2019-05-09  6:06 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Alex Gramiak @ 2019-05-09  4:28 UTC (permalink / raw)
  To: emacs-devel

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.



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-05-13 17:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-09  4:28 Removing the usage of X structures (or their names) in independent code Alex Gramiak
2019-05-09  6:06 ` Eli Zaretskii
2019-05-09 16:26   ` Alex Gramiak
2019-05-09 17:12     ` Eli Zaretskii
2019-05-11  5:45       ` Alex Gramiak
2019-05-13 16:15         ` Alex Gramiak
2019-05-13 17:40           ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).