Fix #703: Fix build on non-glibc platforms
authorDmitry Marakasov <>
Sat, 3 Aug 2019 11:34:42 +0000 (12:34 +0100)
committerKlaus Ethgen <Klaus@Ethgen.de>
Tue, 20 Aug 2019 18:32:40 +0000 (19:32 +0100)
https://github.com/BestImageViewer/geeqie/pull/703

src/pan-view/pan-util.c

index 3fd5cc8..317660b 100644 (file)
@@ -82,6 +82,12 @@ gint pan_date_value(time_t d, PanDateLengthType length)
        return -1;
 }
 
+#if defined(__GLIBC_PREREQ)
+# if __GLIBC_PREREQ(2, 27)
+#  define HAS_GLIBC_STRFTIME_EXTENSIONS
+# endif
+#endif
+
 gchar *pan_date_value_string(time_t d, PanDateLengthType length)
 {
        struct tm td;
@@ -99,7 +105,7 @@ gchar *pan_date_value_string(time_t d, PanDateLengthType length)
                        format = "%A %e";
                        break;
                case PAN_DATE_LENGTH_MONTH:
-#if __GLIBC_PREREQ(2, 27)
+#if defined(HAS_GLIBC_STRFTIME_EXTENSIONS) || defined(__FreeBSD__)
                        format = "%OB %Y";
 #else
                        format = "%B %Y";