- Check for gl_matchc support in glob_t and fall back to the
   openbsd-compat/glob.[ch] support if it does not exist.
diff --git a/includes.h b/includes.h
index 3f834ba..8b7bb0e 100644
--- a/includes.h
+++ b/includes.h
@@ -54,7 +54,8 @@
 #ifdef HAVE_BSTRING_H
 # include <bstring.h>
 #endif
-#if defined(HAVE_GLOB_H) && defined(GLOB_HAS_ALTDIRFUNC)
+#if defined(HAVE_GLOB_H) && defined(GLOB_HAS_ALTDIRFUNC) && \
+    defined(GLOB_HAS_GL_MATCHC)
 # include <glob.h>
 #endif
 #ifdef HAVE_NETGROUP_H