Branch: refs/heads/master Author: Enrico Tröger enrico.troeger@uvena.de Committer: Enrico Tröger enrico.troeger@uvena.de Date: Tue, 19 Mar 2013 13:17:25 UTC Commit: d9c7f59b4187d3b24deae12865fafb5841029b36 https://github.com/geany/geany/commit/d9c7f59b4187d3b24deae12865fafb5841029b...
Log Message: ----------- Improve GTK compatibility macros for GTK 2.16
On GTK 2.16 GTK_WIDGET_[UN]SET_FLAGS resolves to a do-while construct which raises a syntax error when embedded into a ? operator. Also gtk_widget_get_visible() is only available since GTK 2.18, so add a fallback to the old variant.
Modified Paths: -------------- src/gtkcompat.h
Modified: src/gtkcompat.h 6 files changed, 5 insertions(+), 1 deletions(-) =================================================================== @@ -73,13 +73,17 @@ /* GtkWidget */ #if ! GTK_CHECK_VERSION(2, 18, 0) # define compat_widget_set_flag(widget, flag, enable) \ - ((enable) ? GTK_WIDGET_SET_FLAGS((widget), (flag)) : GTK_WIDGET_UNSET_FLAGS((widget), (flag))) + if ((enable)) \ + GTK_WIDGET_SET_FLAGS((widget), (flag)); \ + else \ + GTK_WIDGET_UNSET_FLAGS((widget), (flag)); # define gtk_widget_set_can_default(widget, can_default) \ compat_widget_set_flag((widget), GTK_CAN_DEFAULT, (can_default)) # define gtk_widget_is_toplevel(widget) GTK_WIDGET_TOPLEVEL(widget) # define gtk_widget_is_sensitive(widget) GTK_WIDGET_IS_SENSITIVE(widget) # define gtk_widget_has_focus(widget) GTK_WIDGET_HAS_FOCUS(widget) # define gtk_widget_get_sensitive(widget) GTK_WIDGET_SENSITIVE(widget) +# define gtk_widget_get_visible(widget) GTK_WIDGET_VISIBLE(widget) # define gtk_widget_set_has_window(widget, has_window) \ compat_widget_set_flag((widget), GTK_NO_WINDOW, !(has_window)) # define gtk_widget_set_can_focus(widget, can_focus) \
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).