aboutsummaryrefslogtreecommitdiffhomepage
path: root/gtk/PlatGTK.cxx
diff options
context:
space:
mode:
authorColomban Wendling <ban@herbesfolles.org>2015-05-22 14:26:15 +0200
committerColomban Wendling <ban@herbesfolles.org>2015-05-22 14:26:15 +0200
commit6de85e5ca364ea81ebf85f80e8a1c93004525df3 (patch)
treeb226bf82e93b6b61fab03c712f0b9a93b8153948 /gtk/PlatGTK.cxx
parent88b5a1d9dfb5b03e5cfc36ff0dbaae8fdde81315 (diff)
downloadscintilla-mirror-6de85e5ca364ea81ebf85f80e8a1c93004525df3.tar.gz
GTK: Workaround ABI issue with Windows GTK2 bundle and GCC > 3
GtkScrolledWindow contains a bitfield, and GCC 3.4 and 4.8 don't agree on the size of the structure (regardless of -mms-bitfields): - GCC 3.4 has sizeof(GtkScrolledWindow)=88 - GCC 4.8 has sizeof(GtkScrolledWindow)=84 As Windows GTK2 bundle is built with GCC 3, it requires types derived from GtkScrolledWindow to be at least 88 bytes, which means we need to add some fake padding to fill in the extra 4 bytes. There is however no other issue with the layout difference as we never access any GtkScrolledWindow fields ourselves. See http://lists.geany.org/pipermail/devel/2015-April/thread.html#9379
Diffstat (limited to 'gtk/PlatGTK.cxx')
-rw-r--r--gtk/PlatGTK.cxx17
1 files changed, 16 insertions, 1 deletions
diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx
index f2d8f190e..27c68b93b 100644
--- a/gtk/PlatGTK.cxx
+++ b/gtk/PlatGTK.cxx
@@ -1484,7 +1484,22 @@ ListBox *ListBox::Allocate() {
// SmallScroller, a GtkScrolledWindow that can shrink very small, as
// gtk_widget_set_size_request() cannot shrink widgets on GTK3
-typedef GtkScrolledWindow SmallScroller;
+typedef struct {
+ GtkScrolledWindow parent;
+ /* Workaround ABI issue with Windows GTK2 bundle and GCC > 3.
+ See http://lists.geany.org/pipermail/devel/2015-April/thread.html#9379
+
+ GtkScrolledWindow contains a bitfield, and GCC 3.4 and 4.8 don't agree
+ on the size of the structure (regardless of -mms-bitfields):
+ - GCC 3.4 has sizeof(GtkScrolledWindow)=88
+ - GCC 4.8 has sizeof(GtkScrolledWindow)=84
+ As Windows GTK2 bundle is built with GCC 3, it requires types derived
+ from GtkScrolledWindow to be at least 88 bytes, which means we need to
+ add some fake padding to fill in the extra 4 bytes.
+ There is however no other issue with the layout difference as we never
+ access any GtkScrolledWindow fields ourselves. */
+ int padding;
+} SmallScroller;
typedef GtkScrolledWindowClass SmallScrollerClass;
G_DEFINE_TYPE(SmallScroller, small_scroller, GTK_TYPE_SCROLLED_WINDOW)