[Bug 758012] systemclock: Use mach_time on Apple platforms

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Thu Nov 12 10:56:22 PST 2015


https://bugzilla.gnome.org/show_bug.cgi?id=758012

--- Comment #4 from Heinrich Fink <hfink at toolsonair.com> ---
Merging line 566+567 to a single #elif is not the same logically, though, is
it? I know it looks weird, but it's clearer if you would indent the
preprocessor macros after the first #else (which I did, but was rewritten by
gst-indent). In pseudo code, it currently looks like this:

#if defined __APPLE__
// USE mach_time (always available on Apple platforms)
#else
    #ifdef G_OS_WIN32
    // if win32 pfc is good use it, ELSE ...
    #endif /* G_OS_WIN32 */
    #if !defined HAVE_POSIX_TIMERS || !defined HAVE_CLOCK_GETTIME
    // use g_get_current_time
    #else 
    // use posix timer
    #endif
#endif /* __APPLE__ */

... so basically, on Apple platform we don't need a fallback to something else.
Apparently, on Windows we'd like to have a fallback (at least the current code
does that). If I applied your suggestion, it would look like this: 

#if defined __APPLE__
// USE mach_time (always available on Apple platform)
#elif defined (G_OS_WIN32)
// if win32 pfc is good use it, else ...
#endif
#if !defined HAVE_POSIX_TIMERS || !defined HAVE_CLOCK_GETTIME
// use g_get_current_time
#else 
// use posix timer
#endif

that wouldn't make sense, because we don't need the fallback to using
posix-time/g_get_current_time on __APPLE__, and with the current code that also
wouldn't compile I think (at least have a warning about unreachable code).

Does that make sense? Or did I miss something?

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list