]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
build: Remove compatibility check for clock_gettime().
authorAndre Noll <maan@tuebingen.mpg.de>
Mon, 26 Dec 2016 15:16:36 +0000 (16:16 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Wed, 4 Jan 2017 22:13:22 +0000 (23:13 +0100)
Only Mac OS (which is no longer supported) did not have it. Moreover,
on Linux we used to check whether one needs to link with -lrt to
obtain clock_gettime(), which is necessary for glibc versions 2.16
and earlier (released in 2012). All distributions should have moved
on to newer glibc versions by now, so let's get rid of the check.

Makefile.in
Makefile.real
configure.ac
time.c

index d6830ded76fc6d7ab19c435f93fd809c49f905fd..3c51029bcb16234f2e6f19552c2769d6e50c3f54 100644 (file)
@@ -52,7 +52,6 @@ alsa_cppflags := @alsa_cppflags@
 oss_cppflags := @oss_cppflags@
 mp4v2_cppflags := @mp4v2_cppflags@
 
 oss_cppflags := @oss_cppflags@
 mp4v2_cppflags := @mp4v2_cppflags@
 
-clock_gettime_ldflags := @clock_gettime_ldflags@
 id3tag_ldflags := @id3tag_ldflags@
 ogg_ldflags := @ogg_ldflags@
 vorbis_ldflags := @vorbis_ldflags@
 id3tag_ldflags := @id3tag_ldflags@
 ogg_ldflags := @ogg_ldflags@
 vorbis_ldflags := @vorbis_ldflags@
index ad83809cb3d5d4cb677574292a44f55fbe522bc3..8a8cd4342554f18cc05ca70c3f31a830e2a17e79 100644 (file)
@@ -113,8 +113,6 @@ STRICT_CFLAGS += -Wformat -Wformat-security
 STRICT_CFLAGS += -Wmissing-format-attribute
 STRICT_CFLAGS += -Wdeclaration-after-statement
 
 STRICT_CFLAGS += -Wmissing-format-attribute
 STRICT_CFLAGS += -Wdeclaration-after-statement
 
-LDFLAGS += $(clock_gettime_ldflags)
-
 ifeq ($(uname_s),Linux)
        # these cause warnings on *BSD
        CPPFLAGS += -Wunused-macros
 ifeq ($(uname_s),Linux)
        # these cause warnings on *BSD
        CPPFLAGS += -Wunused-macros
index ec8cbac2a74b4643593f574bbbfcc98859627157..afed0a7997fe147440d4bad66197ab2c494289e7 100644 (file)
@@ -71,19 +71,6 @@ AC_PROG_CC
 AC_PROG_CPP
 
 executables="recv filter audioc write afh play"
 AC_PROG_CPP
 
 executables="recv filter audioc write afh play"
-################################################################## clock_gettime
-clock_gettime_lib=
-AC_CHECK_LIB([c], [clock_gettime], [clock_gettime_lib=c], [
-       AC_CHECK_LIB([rt], [clock_gettime], [clock_gettime_lib=rt], [], [])
-])
-if test -n "$clock_gettime_lib"; then
-       AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [
-               define to 1 if clock_gettime() is supported])
-fi
-if test "$clock_gettime_lib" = "rt"; then
-       AC_SUBST(clock_gettime_ldflags, -lrt)
-fi
-
 ########################################################################### osl
 STASH_FLAGS
 LIB_ARG_WITH([osl], [-losl])
 ########################################################################### osl
 STASH_FLAGS
 LIB_ARG_WITH([osl], [-losl])
diff --git a/time.c b/time.c
index 6bb9a50f5b32f7441943817dc22f868d0f0131cd..90c6735644540f1431afcc1b376da0662823e80c 100644 (file)
--- a/time.c
+++ b/time.c
@@ -198,22 +198,14 @@ void compute_chunk_time(long unsigned chunk_num,
 struct timeval *clock_get_realtime(struct timeval *tv)
 {
        static struct timeval user_friendly;
 struct timeval *clock_get_realtime(struct timeval *tv)
 {
        static struct timeval user_friendly;
+       struct timespec t;
+       int ret;
 
        if (!tv)
                tv = &user_friendly;
 
        if (!tv)
                tv = &user_friendly;
-#ifdef HAVE_CLOCK_GETTIME
-       {
-               struct timespec t;
-               int ret;
-
-               ret = clock_gettime(CLOCK_REALTIME, &t);
-               assert(ret == 0);
-               tv->tv_sec = t.tv_sec;
-               tv->tv_usec = t.tv_nsec / 1000;
-       }
-#else
-       #include <sys/time.h>
-       gettimeofday(tv, NULL);
-#endif /* HAVE_CLOCK_GETTIME */
+       ret = clock_gettime(CLOCK_REALTIME, &t);
+       assert(ret == 0);
+       tv->tv_sec = t.tv_sec;
+       tv->tv_usec = t.tv_nsec / 1000;
        return tv;
 }
        return tv;
 }