From 8ee12773d885d906d02340377996895144c14385 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 8 Aug 2015 15:06:15 +0100 Subject: [PATCH] GTK 3 prep: do not include individual GTK/GDK headers. This is the first of several cleanup steps recommended by the GTK 2->3 migration guide. I intend to begin work towards compatibility with GTK 3, but without breaking GTK 2 and even GTK 1 compatibility in the process; GTK 2 is still useful to _me_ (not least because it permits much easier support of old-style server-side X11 fonts), and I recall hearing a rumour that at least one kind of strange system can only run GTK 1, so for the moment I don't intend to stop supporting either. Including gdkkeysyms.h is not optional in GTK 2, because gdk.h does not include it. In GTK 3 it does, so we don't explicitly reinclude it ourselves. We now build cleanly in GTK2 with -DGTK_DISABLE_SINGLE_INCLUDES. (But that doesn't say much, because we did already! Apparently gdkkeysyms.h was a special case which that #define didn't forbid.) --- unix/gtkask.c | 3 +++ unix/gtkdlg.c | 2 ++ unix/gtkfont.c | 2 ++ unix/gtkwin.c | 2 ++ 4 files changed, 9 insertions(+) diff --git a/unix/gtkask.c b/unix/gtkask.c index f21ff0a1..38946842 100644 --- a/unix/gtkask.c +++ b/unix/gtkask.c @@ -9,7 +9,10 @@ #include #include +#include +#if !GTK_CHECK_VERSION(3,0,0) #include +#endif #include "gtkcompat.h" diff --git a/unix/gtkdlg.c b/unix/gtkdlg.c index 6c532024..282396e6 100644 --- a/unix/gtkdlg.c +++ b/unix/gtkdlg.c @@ -7,7 +7,9 @@ #include #include #include +#if !GTK_CHECK_VERSION(3,0,0) #include +#endif #include #include #include diff --git a/unix/gtkfont.c b/unix/gtkfont.c index d776dfa5..012dfea1 100644 --- a/unix/gtkfont.c +++ b/unix/gtkfont.c @@ -13,7 +13,9 @@ #include #include #include +#if !GTK_CHECK_VERSION(3,0,0) #include +#endif #include #include #include diff --git a/unix/gtkwin.c b/unix/gtkwin.c index e8345881..6f59f687 100644 --- a/unix/gtkwin.c +++ b/unix/gtkwin.c @@ -19,7 +19,9 @@ #include #include #include +#if !GTK_CHECK_VERSION(3,0,0) #include +#endif #include #include #include -- 2.45.2