1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-01 03:22:48 -05:00

Fix build failures under GTK 1.

My previous dodge to make the GTK 1 headers work with modern compilers
was to manually reset to -std=gnu89, which changed the semantics of
'inline' back to what glib.h was expecting. But that doesn't work now
the PuTTY code base expects to be able to use the rest of C99, so
instead I have to manually override the specific #defines that glib.h
uses to know how 'inline' works.

Also, moved that code in configure.ac out of the fallback branch that
manually detects GTK1, so that it will fire even if autoconf is run on
a system that still has the genuine GTK1 detection code. (Amazingly,
one still exists that I have access to!)

With that fixed, there's one more problem: the nethack_mode and
app_keypad_mode flags in gtkwin.c's key_event() are only used in the
GTK >= 2 branch of the ifdefs, so they should only be declared and set
in that branch as well, on pain of a -Wunused complaint.
This commit is contained in:
Simon Tatham
2019-03-12 07:52:52 +00:00
parent ba91e4b996
commit f098dc748d
2 changed files with 19 additions and 9 deletions

View File

@ -990,7 +990,6 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data)
wchar_t ucsoutput[2];
int ucsval, start, end, output_charset;
bool special, use_ucsoutput;
bool nethack_mode, app_keypad_mode;
bool force_format_numeric_keypad = false;
bool generated_something = false;
char num_keypad_key = '\0';
@ -1392,10 +1391,6 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data)
special = false;
use_ucsoutput = false;
nethack_mode = conf_get_bool(inst->conf, CONF_nethack_keypad);
app_keypad_mode = (inst->term->app_keypad_keys &&
!conf_get_bool(inst->conf, CONF_no_applic_k));
/* ALT+things gives leading Escape. */
output[0] = '\033';
#if !GTK_CHECK_VERSION(2,0,0)
@ -1418,6 +1413,10 @@ gint key_event(GtkWidget *widget, GdkEventKey *event, gpointer data)
* it to.
*/
bool numeric = false;
bool nethack_mode = conf_get_bool(inst->conf, CONF_nethack_keypad);
bool app_keypad_mode = (inst->term->app_keypad_keys &&
!conf_get_bool(inst->conf, CONF_no_applic_k));
switch (event->keyval) {
case GDK_KEY_Num_Lock: num_keypad_key = 'G'; break;
case GDK_KEY_KP_Divide: num_keypad_key = '/'; break;