grim/guifications2

Patch from nosnilmot to really fix the G_GNUC_NULL_TERMINATED stuff in
org.guifications.gf2
2007-12-16, Stu Tomlinson
ccbf4083ef38
Parents ed1aa04713da
Children 54c5c7870a90
Patch from nosnilmot to really fix the G_GNUC_NULL_TERMINATED stuff in
Guifications.
--- a/src/gf_action.c Sun Dec 16 06:59:43 2007 -0500
+++ b/src/gf_action.c Sun Dec 16 20:40:59 2007 -0500
@@ -18,6 +18,12 @@
*/
#include <gtk/gtk.h>
+#ifdef HAVE_CONFIG_H
+# include "../gf_config.h"
+#endif
+
+#include "gf_internal.h"
+
#include <account.h>
#include <blist.h>
#include <debug.h>
@@ -40,7 +46,6 @@
#include "gf_display.h"
#include "gf_event.h"
#include "gf_event_info.h"
-#include "gf_internal.h"
#include "gf_notification.h"
#include "gf_preferences.h"
#include "gf_utils.h"
--- a/src/gf_blist.c Sun Dec 16 06:59:43 2007 -0500
+++ b/src/gf_blist.c Sun Dec 16 20:40:59 2007 -0500
@@ -20,6 +20,11 @@
#include <gtk/gtk.h>
#include <string.h>
+#ifdef HAVE_CONFIG_H
+# include "../gf_config.h"
+#endif
+#include "gf_internal.h"
+
#include <blist.h>
#include <debug.h>
#include <gtkutils.h>
@@ -28,12 +33,7 @@
#include <version.h>
-#ifdef HAVE_CONFIG_H
-# include "../gf_config.h"
-#endif
-
#include "gf_blist.h"
-#include "gf_internal.h"
#include "gf_notification.h"
#include "gf_theme.h"
#include "gf_theme_info.h"
--- a/src/gf_display.c Sun Dec 16 06:59:43 2007 -0500
+++ b/src/gf_display.c Sun Dec 16 20:40:59 2007 -0500
@@ -30,6 +30,12 @@
typedef BOOL WINAPI GF_GetMonitorInfo(HMONITOR,LPMONITORINFO);
#endif /* _WIN32 */
+#ifdef HAVE_CONFIG_H
+# include "../gf_config.h"
+#endif
+
+#include "gf_internal.h"
+
#include <glib.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
--- a/src/gf_event.c Sun Dec 16 06:59:43 2007 -0500
+++ b/src/gf_event.c Sun Dec 16 20:40:59 2007 -0500
@@ -19,6 +19,12 @@
#include <glib.h>
#include <string.h>
+#ifdef HAVE_CONFIG_H
+# include "../gf_config.h"
+#endif
+
+#include "gf_internal.h"
+
#include <debug.h>
#include <account.h>
#include <blist.h>
@@ -32,14 +38,9 @@
#include <version.h>
-#ifdef HAVE_CONFIG_H
-# include "../gf_config.h"
-#endif
-
#include "gf_blist.h"
#include "gf_display.h"
#include "gf_event.h"
-#include "gf_internal.h"
#include "gf_notification.h"
#include "gf_preferences.h"
--- a/src/gf_event_info.c Sun Dec 16 06:59:43 2007 -0500
+++ b/src/gf_event_info.c Sun Dec 16 20:40:59 2007 -0500
@@ -18,6 +18,12 @@
*/
#include <glib.h>
+#ifdef HAVE_CONFIG_H
+# include "../gf_config.h"
+#endif
+
+#include "gf_internal.h"
+
#include <debug.h>
#include <account.h>
#include <blist.h>
--- a/src/gf_gtk_utils.c Sun Dec 16 06:59:43 2007 -0500
+++ b/src/gf_gtk_utils.c Sun Dec 16 20:40:59 2007 -0500
@@ -18,6 +18,11 @@
*/
#include <debug.h>
+#ifdef HAVE_CONFIG_H
+# include "../gf_config.h"
+#endif
+
+#include "gf_internal.h"
#include "gf_gtk_utils.h"
/******************************************************************************
--- a/src/gf_internal.h Sun Dec 16 06:59:43 2007 -0500
+++ b/src/gf_internal.h Sun Dec 16 20:40:59 2007 -0500
@@ -35,6 +35,16 @@
#endif
#endif
+/* This works around the lack of G_GNUC_NULL_TERMINATED in old glib and the
+ * lack of the NULL sentinel in GCC older than 4.0.0 and non-GCC compilers */
+#ifndef G_GNUC_NULL_TERMINATED
+# if __GNUC__ >= 4
+# define G_GNUC_NULL_TERMINATED __attribute__((__sentinel__))
+# else
+# define G_GNUC_NULL_TERMINATED
+# endif
+#endif
+
#if GLIB_CHECK_VERSION(2,6,0)
# include <glib/gstdio.h>
#endif /* GLIB_CHECK_VERSION(2,6,0) */
--- a/src/gf_item.c Sun Dec 16 06:59:43 2007 -0500
+++ b/src/gf_item.c Sun Dec 16 20:40:59 2007 -0500
@@ -25,9 +25,9 @@
#ifdef HAVE_CONFIG_H
# include "../gf_config.h"
#endif
+#include "gf_internal.h"
#include "gf_event_info.h"
-#include "gf_internal.h"
#include "gf_item.h"
#include "gf_item_icon.h"
#include "gf_item_image.h"
--- a/src/gf_item_icon.c Sun Dec 16 06:59:43 2007 -0500
+++ b/src/gf_item_icon.c Sun Dec 16 20:40:59 2007 -0500
@@ -20,6 +20,11 @@
#include <gtk/gtk.h>
#include <gdk/gdk.h>
+#ifdef HAVE_CONFIG_H
+# include "../gf_config.h"
+#endif
+#include "gf_internal.h"
+
#include <account.h>
#include <buddyicon.h>
#include <debug.h>
@@ -28,12 +33,7 @@
#include <gtkutils.h>
-#ifdef HAVE_CONFIG_H
-# include "../gf_config.h"
-#endif
-
#include "gf_gtk_utils.h"
-#include "gf_internal.h"
#include "gf_item.h"
#include "gf_item_icon.h"
--- a/src/gf_item_image.c Sun Dec 16 06:59:43 2007 -0500
+++ b/src/gf_item_image.c Sun Dec 16 20:40:59 2007 -0500
@@ -19,6 +19,11 @@
#include <glib.h>
#include <gdk/gdk.h>
+#ifdef HAVE_CONFIG_H
+# include "../gf_config.h"
+#endif
+#include "gf_internal.h"
+
#include <debug.h>
#include <xmlnode.h>
--- a/src/gf_item_offset.c Sun Dec 16 06:59:43 2007 -0500
+++ b/src/gf_item_offset.c Sun Dec 16 20:40:59 2007 -0500
@@ -20,6 +20,10 @@
#include <string.h>
#include <stdlib.h>
+#ifdef HAVE_CONFIG_H
+# include "../gf_config.h"
+#endif
+#include "gf_internal.h"
#include <xmlnode.h>
--- a/src/gf_item_text.c Sun Dec 16 06:59:43 2007 -0500
+++ b/src/gf_item_text.c Sun Dec 16 20:40:59 2007 -0500
@@ -38,6 +38,8 @@
#include <string.h>
#include <time.h>
+#include "gf_internal.h"
+
#include <account.h>
#include <conversation.h>
#include <debug.h>
@@ -57,7 +59,6 @@
#include "gf_event_info.h"
#include "gf_gtk_utils.h"
#include "gf_item.h"
-#include "gf_internal.h"
#include "gf_item_text.h"
#include "gf_notification.h"
#include "gf_preferences.h"
--- a/src/gf_menu.c Sun Dec 16 06:59:43 2007 -0500
+++ b/src/gf_menu.c Sun Dec 16 20:40:59 2007 -0500
@@ -21,10 +21,10 @@
#ifdef HAVE_CONFIG_H
# include "../gf_config.h"
#endif
+#include "gf_internal.h"
#include "gf_action.h"
#include "gf_display.h"
-#include "gf_internal.h"
#include "gf_item.h"
#include "gf_item_icon.h"
#include "gf_item_text.h"
--- a/src/gf_notification.c Sun Dec 16 06:59:43 2007 -0500
+++ b/src/gf_notification.c Sun Dec 16 20:40:59 2007 -0500
@@ -20,6 +20,11 @@
#include <glib.h>
#include <gdk/gdk.h>
+#ifdef HAVE_CONFIG_H
+# include "../gf_config.h"
+#endif
+#include "gf_internal.h"
+
#include <debug.h>
#include <xmlnode.h>
--- a/src/gf_preferences.c Sun Dec 16 06:59:43 2007 -0500
+++ b/src/gf_preferences.c Sun Dec 16 20:40:59 2007 -0500
@@ -24,6 +24,12 @@
#include <unistd.h>
#include <string.h>
+#ifdef HAVE_CONFIG_H
+# include "../gf_config.h"
+#endif
+
+#include "gf_internal.h"
+
#include <debug.h>
#include <notify.h>
#include <plugin.h>
@@ -33,16 +39,10 @@
#include <gtkutils.h>
#include <gtkprefs.h>
-
-#ifdef HAVE_CONFIG_H
-# include "../gf_config.h"
-#endif
-
#include "gf_action.h"
#include "gf_display.h"
#include "gf_event.h"
#include "gf_file.h"
-#include "gf_internal.h"
#include "gf_menu.h"
#include "gf_preferences.h"
#include "gf_stock.h"
--- a/src/gf_theme.c Sun Dec 16 06:59:43 2007 -0500
+++ b/src/gf_theme.c Sun Dec 16 20:40:59 2007 -0500
@@ -23,16 +23,16 @@
#include <string.h>
#include <stdlib.h>
-#include <debug.h>
-#include <util.h>
-#include <xmlnode.h>
-
-
#ifdef HAVE_CONFIG_H
# include "../gf_config.h"
#endif
#include "gf_internal.h"
+
+#include <debug.h>
+#include <util.h>
+#include <xmlnode.h>
+
#include "gf_item.h"
#include "gf_preferences.h"
#include "gf_theme_info.h"
--- a/src/gf_theme_editor.c Sun Dec 16 06:59:43 2007 -0500
+++ b/src/gf_theme_editor.c Sun Dec 16 20:40:59 2007 -0500
@@ -26,6 +26,7 @@
#include <sys/types.h>
#include <string.h>
+#include "gf_internal.h"
#define PURPLE_PLUGINS
#include <debug.h>
@@ -40,7 +41,6 @@
#include "gf_event.h"
#include "gf_file.h"
-#include "gf_internal.h"
#include "gf_item.h"
#include "gf_item_icon.h"
#include "gf_item_image.h"
--- a/src/gf_theme_info.c Sun Dec 16 06:59:43 2007 -0500
+++ b/src/gf_theme_info.c Sun Dec 16 20:40:59 2007 -0500
@@ -28,6 +28,11 @@
gchar *website;
};
+#ifdef HAVE_CONFIG_H
+# include "../gf_config.h"
+#endif
+
+#include "gf_internal.h"
#include "gf_theme_info.h"
#include <debug.h>
--- a/src/gf_theme_ops.c Sun Dec 16 06:59:43 2007 -0500
+++ b/src/gf_theme_ops.c Sun Dec 16 20:40:59 2007 -0500
@@ -26,6 +26,10 @@
gchar *ellipsis;
};
+#ifdef HAVE_CONFIG_H
+# include "../gf_config.h"
+#endif
+#include "gf_internal.h"
#include "gf_theme_ops.h"
#include <debug.h>
--- a/src/gf_utils.c Sun Dec 16 06:59:43 2007 -0500
+++ b/src/gf_utils.c Sun Dec 16 20:40:59 2007 -0500
@@ -19,6 +19,11 @@
#include <glib.h>
#include <string.h>
+#ifdef HAVE_CONFIG_H
+# include "../gf_config.h"
+#endif
+
+#include "gf_internal.h"
#include "gf_utils.h"
gint
--- a/src/guifications.c Sun Dec 16 06:59:43 2007 -0500
+++ b/src/guifications.c Sun Dec 16 20:40:59 2007 -0500
@@ -22,12 +22,12 @@
#define PURPLE_PLUGINS
+#include "gf_internal.h"
#include "gf_action.h"
#include "gf_blist.h"
#include "gf_display.h"
#include "gf_event.h"
#include "gf_gtk_utils.h"
-#include "gf_internal.h"
#include "gf_item_text.h"
#include "gf_preferences.h"
#include "gf_theme.h"