diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2019-12-07 14:04:00 +0000 |
---|---|---|
committer | GStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2019-12-09 07:33:55 +0000 |
commit | 98ebcb4b8af31a07ac935eeaa1d101dc70cd43d4 (patch) | |
tree | 36e9df5f5c58c40d82cce0a01a9dd53ede2b430c | |
parent | c8ff6f82a5d734304542fd46e687c64ede265cea (diff) | |
download | gstreamer-plugins-base-98ebcb4b8af31a07ac935eeaa1d101dc70cd43d4.tar.gz |
pango: check if localtime_r is available
HAVE_LOCALTIME_R was used, but never defined.
-rw-r--r-- | ext/pango/gstclockoverlay.c | 16 | ||||
-rw-r--r-- | meson.build | 1 |
2 files changed, 9 insertions, 8 deletions
diff --git a/ext/pango/gstclockoverlay.c b/ext/pango/gstclockoverlay.c index 46fda8c4f..1a0258d21 100644 --- a/ext/pango/gstclockoverlay.c +++ b/ext/pango/gstclockoverlay.c @@ -79,17 +79,17 @@ gst_clock_overlay_render_time (GstClockOverlay * overlay) time_t now; gchar buf[256]; -#ifdef HAVE_LOCALTIME_R - struct tm dummy; -#endif - now = time (NULL); #ifdef HAVE_LOCALTIME_R - /* Need to call tzset explicitly when calling localtime_r for changes - to the timezone between calls to be visible. */ - tzset (); - t = localtime_r (&now, &dummy); + { + struct tm dummy; + + /* Need to call tzset explicitly when calling localtime_r for changes + * to the timezone between calls to be visible. */ + tzset (); + t = localtime_r (&now, &dummy); + } #else /* on win32 this apparently returns a per-thread struct which would be fine */ t = localtime (&now); diff --git a/meson.build b/meson.build index f95df5d97..a8d7134a4 100644 --- a/meson.build +++ b/meson.build @@ -136,6 +136,7 @@ endforeach check_functions = [ ['HAVE_DCGETTEXT', 'dcgettext', '#include<libintl.h>'], ['HAVE_GMTIME_R', 'gmtime_r', '#include<time.h>'], + ['HAVE_LOCALTIME_R', 'localtime_r', '#include<time.h>'], ['HAVE_LRINTF', 'lrintf', '#include<math.h>'], ['HAVE_MMAP', 'mmap', '#include<sys/mman.h>'], ['HAVE_LOG2', 'log2', '#include<math.h>'], |