diff --git a/gst/isomp4/gstqtmux.c b/gst/isomp4/gstqtmux.c
index c43d612..12b2608 100644
--- a/gst/isomp4/gstqtmux.c
+++ b/gst/isomp4/gstqtmux.c
@@ -142,6 +142,18 @@
 
 #include "gstqtmux.h"
 
+#ifdef __APPLE__
+#include <AvailabilityMacros.h>
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
+static size_t
+strnlen (const char * str, size_t max)
+{
+  const char *end = memchr (str, 0, max);
+  return end ? (size_t)(end - str) : max;
+}
+#endif
+#endif
+
 GST_DEBUG_CATEGORY_STATIC (gst_qt_mux_debug);
 #define GST_CAT_DEFAULT gst_qt_mux_debug
 
