all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alex Gramiak <agrambot@gmail.com>
To: emacs-devel@gnu.org
Subject: Removing the usage of X structures (or their names) in independent code
Date: Wed, 08 May 2019 22:28:23 -0600	[thread overview]
Message-ID: <875zqkdzfc.fsf@gmail.com> (raw)

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	other threads:[~2019-05-09  4:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-09  4:28 Alex Gramiak [this message]
2019-05-09  6:06 ` Removing the usage of X structures (or their names) in independent code 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875zqkdzfc.fsf@gmail.com \
    --to=agrambot@gmail.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.