[PATCH] Cygwin: Make native clipboard layout same for 32- and 64-bit
Mark Geisert
mark@maxrnd.com
Mon Oct 11 06:13:41 GMT 2021
Ken Brown wrote:
> On 10/9/2021 10:29 AM, Jon Turney wrote:
[...]
>>> On 10/8/2021 5:52 AM, Takashi Yano wrote:
[...]
Thanks all for the comments; much appreciated. They'll be factored into v2 in one
form or another. I pronounced my original patch "bad" not because of any problem
with code operation or struct cygcb_t definition. I used anonymous union and
anonymous struct internally to mostly realize what Takashi suggested for layout,
just naming the items cb_* rather than tv_* or other. The code works as intended,
32- and 64-bit.
It's just that after submitting the patch I realized that, if we really are going
to support both Cygwin archs (x86_64 and i686), there is still the issue of
different cygcb_t layouts between Cygwin versions being ignored.
Specifically, the fhandler_clipboard::fstat routine can't tell which Cygwin
environment has set the clipboard contents. My original patch takes care of
32-bit and 64-bit, providing both are running Cygwin >= 3.3.0 (presumably). What
if it was a different version (pre 3.3.0) that set the contents?
So I'm working on a heuristic to identify which cygcb_t layout is present in the
clipboard data. This will hopefully distinguish between the 3 historical cygcb_t
layouts as well as x86_64 differing from i686 for each one.
Stay tuned,
..mark
More information about the Cygwin-patches
mailing list