diff --git a/glib/gstrfuncs.c b/glib/gstrfuncs.c
index 46c5d06..913a041 100644
--- a/glib/gstrfuncs.c
+++ b/glib/gstrfuncs.c
@@ -1272,7 +1272,7 @@ g_strerror (gint errnum)
       gchar buf[1024];
       GError *error = NULL;
 
-#if defined(G_OS_WIN32)
+#if defined(G_OS_WIN32) && defined (_MSC_VER)
       strerror_s (buf, sizeof (buf), errnum);
       msg = buf;
 #elif defined(HAVE_STRERROR_R)
