Skip to content

Commit

Permalink
pango: check if localtime_r is available
Browse files Browse the repository at this point in the history
HAVE_LOCALTIME_R was used, but never defined.
  • Loading branch information
tp-m authored and GStreamer Merge Bot committed Dec 9, 2019
1 parent c8ff6f8 commit 98ebcb4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
16 changes: 8 additions & 8 deletions ext/pango/gstclockoverlay.c
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions meson.build
Expand Up @@ -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>'],
Expand Down

0 comments on commit 98ebcb4

Please sign in to comment.