diff options
author | Colomban Wendling <ban@herbesfolles.org> | 2015-05-22 14:26:15 +0200 |
---|---|---|
committer | Colomban Wendling <ban@herbesfolles.org> | 2015-05-22 14:26:15 +0200 |
commit | 06d04fb37a82847f1270bd93d0148acd4e41777d (patch) | |
tree | 1037955074cb196c1945e20d65cbdcda7e52b89b | |
parent | 9c43289e4c9004ba5c9c5f61d9fec72bfdf08a5e (diff) | |
download | scintilla-mirror-06d04fb37a82847f1270bd93d0148acd4e41777d.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
-rw-r--r-- | gtk/PlatGTK.cxx | 17 |
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) |