diff --git a/ChangeLog b/ChangeLog
index 3bee534765cbacc964fb1e46f1ccd68abe594784..d3eb489ae3e6c1574aca63c59bed278e3c78977f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-09-14	Benedikt Meurer <benny@xfce.org>
+
+	* thunarx/thunarx-config.h.in, thunarx/thunarx-file-info.h: Fix build
+	  with GLib 2.6.x. Bug #2317.
+
 2006-09-14	Benedikt Meurer <benny@xfce.org>
 
 	* thunarx/thunarx-menu-provider.{c,h}, thunarx/thunarx.symbols: Add a
diff --git a/thunarx/thunarx-config.h.in b/thunarx/thunarx-config.h.in
index 7305266ee233806fbf2961d96ac79530afde2bb7..98c5b5eedeeeca92bb3d0efa63544579daba7693 100644
--- a/thunarx/thunarx-config.h.in
+++ b/thunarx/thunarx-config.h.in
@@ -1,6 +1,6 @@
 /* $Id$ */
 /*-
- * Copyright (c) 2005 Benedikt Meurer <benny@xfce.org>
+ * Copyright (c) 2005-2006 Benedikt Meurer <benny@xfce.org>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public
@@ -25,7 +25,7 @@
 #ifndef __THUNARX_CONFIG_H__
 #define __THUNARX_CONFIG_H__
 
-#include <glib.h>
+#include <glib-object.h>
 
 G_BEGIN_DECLS;
 
@@ -49,6 +49,15 @@ const gchar *thunarx_check_version (guint required_major,
                                     guint required_minor,
                                     guint required_micro);
 
+/* verify that G_GNUC_WARN_UNUSED_RESULT is defined */
+#if !defined(G_GNUC_WARN_UNUSED_RESULT)
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#define G_GNUC_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
+#else
+#define G_GNUC_WARN_UNUSED_RESULT
+#endif /* __GNUC__ */
+#endif /* !defined(G_GNUC_WARN_UNUSED_RESULT) */
+
 G_END_DECLS;
 
 #endif /* !__THUNARX_CONFIG_H__ */
diff --git a/thunarx/thunarx-file-info.h b/thunarx/thunarx-file-info.h
index 395eb2300010d1132efad214e56c9f9ce5854a9a..c6a00b07d15734b3a41d6c76a0da6c05aaee2e0a 100644
--- a/thunarx/thunarx-file-info.h
+++ b/thunarx/thunarx-file-info.h
@@ -25,7 +25,7 @@
 #ifndef __THUNARX_FILE_INFO_H__
 #define __THUNARX_FILE_INFO_H__
 
-#include <glib-object.h>
+#include <thunarx/thunarx-config.h>
 
 G_BEGIN_DECLS;