diff --git a/gio/tests/defaultvalue.c b/gio/tests/defaultvalue.c
index f99f98b28..bbc8b3ee2 100644
--- a/gio/tests/defaultvalue.c
+++ b/gio/tests/defaultvalue.c
@@ -17,9 +17,15 @@
* along with this library; if not, see .
*/
+#include "config.h"
+
#include
#include
+#ifdef HAVE_COCOA
+#include
+#endif
+
static void
check_property (const char *output,
GParamSpec *pspec,