$OpenBSD: patch-libdocument_ev-document-misc_c,v 1.2 2018/10/27 13:28:06 jasper Exp $

error: #pragma GCC diagnostic not allowed inside functions

Index: libdocument/ev-document-misc.c
--- libdocument/ev-document-misc.c.orig
+++ libdocument/ev-document-misc.c
@@ -532,8 +532,10 @@ ev_document_misc_format_date (GTime utime)
 	char s[256];
 	const char fmt_hack[] = "%c";
 	size_t len;
+#if defined(__GNUC__) && (__GNUC__ > 4)
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wformat-y2k"
+#endif
 #ifdef HAVE_LOCALTIME_R
 	struct tm t;
 	if (time == 0 || !localtime_r (&time, &t)) return NULL;
@@ -543,7 +545,9 @@ ev_document_misc_format_date (GTime utime)
 	if (time == 0 || !(t = localtime (&time)) ) return NULL;
 	len = strftime (s, sizeof (s), fmt_hack, t);
 #endif
+#if defined(__GNUC__) && (__GNUC__ > 4)
 #pragma GCC diagnostic pop
+#endif
 
 	if (len == 0 || s[0] == '\0') return NULL;
 
