1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-03-12 18:13:50 -05:00

r8854/5 broke compilation with Gtk 1.2. Grow a hack to cope.

[originally from svn r8901]
[r8854 == 14247162f7bd9969361cb8c6276c73dd18ea11ee]
[r8855 == 7e16457d14ffae47303da8c48af98de68bb3a6ed]
This commit is contained in:
Jacob Nevins 2010-03-14 18:58:20 +00:00
parent 9f4b758db2
commit 4a8c45f9f7

View File

@ -34,6 +34,16 @@
#define CAT(x,y) CAT2(x,y)
#define ASSERT(x) enum {CAT(assertion_,__LINE__) = 1 / (x)}
#if GTK_CHECK_VERSION(2,0,0)
ASSERT(sizeof(long) <= sizeof(gsize));
#define LONG_TO_GPOINTER(l) GSIZE_TO_POINTER(l)
#define GPOINTER_TO_LONG(p) GPOINTER_TO_SIZE(p)
#else /* Gtk 1.2 */
ASSERT(sizeof(long) <= sizeof(gpointer));
#define LONG_TO_GPOINTER(l) ((gpointer)(long)(l))
#define GPOINTER_TO_LONG(p) ((long)(p))
#endif
/* Colours come in two flavours: configurable, and xterm-extended. */
#define NCFGCOLOURS (lenof(((Config *)0)->colours))
#define NEXTCOLOURS 240 /* 216 colour-cube plus 24 shades of grey */
@ -1280,14 +1290,14 @@ void notify_remote_exit(void *frontend)
static gint timer_trigger(gpointer data)
{
long now = GPOINTER_TO_SIZE(data);
long now = GPOINTER_TO_LONG(data);
long next;
long ticks;
if (run_timers(now, &next)) {
ticks = next - GETTICKCOUNT();
timer_id = gtk_timeout_add(ticks > 0 ? ticks : 1, timer_trigger,
GSIZE_TO_POINTER(next));
LONG_TO_GPOINTER(next));
}
/*
@ -1309,7 +1319,7 @@ void timer_change_notify(long next)
ticks = 1; /* just in case */
timer_id = gtk_timeout_add(ticks, timer_trigger,
GSIZE_TO_POINTER(next));
LONG_TO_GPOINTER(next));
}
void fd_input_func(gpointer data, gint sourcefd, GdkInputCondition condition)