1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-08 08:58:00 +00:00

Fix build failure at -DNOT_X_WINDOWS.

I had been indecisive about whether the definitions and calls of
store_cutbuffer and retrieve_cutbuffer should be compiled out
completely in GTK-without-X mode, or whether the definitions should be
left in as stubs and the calls still present. retrieve_cutbuffer ended
up with a definition but no call in that mode.

It was only an unused-function warning, but -Werror promoted it to an
error. Fixed by making up my mind: now the functions are completely
absent, and so are the calls to them.
This commit is contained in:
Simon Tatham 2021-01-26 18:12:48 +00:00
parent aef7640bba
commit d851df486f
2 changed files with 7 additions and 5 deletions

View File

@ -115,6 +115,7 @@ Making a release candidate build
+ on at least a reasonably current stable Linux distro, and
also try Debian sid
+ test-build with all of GTK 1, 2 and 3
+ test-build with -DNOT_X_WINDOWS
* feed the release-candidate source to Coverity and make sure it
didn't turn up any last-minute problems
* make sure we have a clean run of sctest

View File

@ -2880,16 +2880,16 @@ static void gtkwin_clip_request_paste(TermWin *tw, int clipboard)
* GtkTargetList.) But that work can wait until there's a need for it!
*/
#ifndef NOT_X_WINDOWS
/* Store the data in a cut-buffer. */
static void store_cutbuffer(GtkFrontend *inst, char *ptr, int len)
{
#ifndef NOT_X_WINDOWS
if (inst->disp) {
/* ICCCM says we must rotate the buffers before storing to buffer 0. */
XRotateBuffers(inst->disp, 1);
XStoreBytes(inst->disp, ptr, len);
}
#endif
}
/* Retrieve data from a cut-buffer.
@ -2897,7 +2897,6 @@ static void store_cutbuffer(GtkFrontend *inst, char *ptr, int len)
*/
static char *retrieve_cutbuffer(GtkFrontend *inst, int *nbytes)
{
#ifndef NOT_X_WINDOWS
char *ptr;
if (!inst->disp) {
*nbytes = 0;
@ -2909,12 +2908,12 @@ static char *retrieve_cutbuffer(GtkFrontend *inst, int *nbytes)
ptr = 0;
}
return ptr;
#else
*nbytes = 0;
return NULL;
#endif
}
#endif /* NOT_X_WINDOWS */
static void gtkwin_clip_write(
TermWin *tw, int clipboard, wchar_t *data, int *attr,
truecolour *truecolour, int len, bool must_deselect)
@ -2995,9 +2994,11 @@ static void gtkwin_clip_write(
sresize(state->pasteout_data, state->pasteout_data_len, char);
}
#ifndef NOT_X_WINDOWS
/* The legacy X cut buffers go with PRIMARY, not any other clipboard */
if (state->atom == GDK_SELECTION_PRIMARY)
store_cutbuffer(inst, state->pasteout_data, state->pasteout_data_len);
#endif
if (gtk_selection_owner_set(inst->area, state->atom,
inst->input_event_time)) {