Project

General

Profile

Bug #4028

won't compile on MacOS Sierra (10.12) Platforms without monotonic clocks are not supported

Added by John Lee about 8 years ago. Updated over 7 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
-
Category:
General
Target version:
-
Start date:
2016-10-19
Due date:
% Done:

100%

Estimated time:
Found in version:
b15b02c
Affected Versions:

Description

/Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile.webui LANGUAGES="ach ady ar bg cs da de en_US en_GB es et fa fi fr he hr he hr hu it ko lv nl no pl pt ro ru sl sk sq sv tr uk zh zh-Hans" all
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile.webui WEBUI=std compile-std
WEBUI std finished
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile.webui WEBUI=debug compile-debug
WEBUI debug finished
CC src/uuid.o
In file included from src/uuid.c:20:
In file included from /Users/johnmclee/Documents/dev/research/tvheadend/src/tvheadend.h:41:
In file included from /Users/johnmclee/Documents/dev/research/tvheadend/src/tvhlog.h:33:
/Users/johnmclee/Documents/dev/research/tvheadend/src/clock.h:29:2: error:
"Platforms without monotonic clocks are not supported!"
#error "Platforms without monotonic clocks are not supported!"
^
/Users/johnmclee/Documents/dev/research/tvheadend/src/clock.h:30:9: error:
'CLOCK_MONOTONIC' macro redefined [-Werror,-Wmacro-redefined]
#define CLOCK_MONOTONIC 0
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/time.h:156:9: note:
previous definition is here
#define CLOCK_MONOTONIC CLOCK_MONOTONIC
^
In file included from src/uuid.c:20:
In file included from /Users/johnmclee/Documents/dev/research/tvheadend/src/tvheadend.h:41:
In file included from /Users/johnmclee/Documents/dev/research/tvheadend/src/tvhlog.h:33:
/Users/johnmclee/Documents/dev/research/tvheadend/src/clock.h:31:9: error:
'CLOCK_REALTIME' macro redefined [-Werror,-Wmacro-redefined]
#define CLOCK_REALTIME 0
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/time.h:154:9: note:
previous definition is here
#define CLOCK_REALTIME _CLOCK_REALTIME
^
In file included from src/uuid.c:20:
In file included from /Users/johnmclee/Documents/dev/research/tvheadend/src/tvheadend.h:41:
In file included from /Users/johnmclee/Documents/dev/research/tvheadend/src/tvhlog.h:33:
/Users/johnmclee/Documents/dev/research/tvheadend/src/clock.h:33:19: error:
conflicting types for 'clock_gettime'
static inline int clock_gettime(int clk_id, struct timespec* t) {
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/time.h:177:5: note:
previous declaration is here
int clock_gettime(clockid_t __clock_id, struct timespec
_tp);
^
4 errors generated.
make: *
* [/Users/johnmclee/Documents/dev/research/tvheadend/build.darwin/src/uuid.o] Error 1
Engde-MacBook-Pro:tvheadend johnmclee$

History

#1

Updated by Johan Lindstrom over 7 years ago

I also get this, any update on how to fix this?

#2

Updated by Jaroslav Kysela over 7 years ago

Could you try this change?

diff --git a/src/clock.h b/src/clock.h
index 2dfceef..2be967c 100644
--- a/src/clock.h
+++ b/src/clock.h
@@ -25,7 +25,7 @@
 #define CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC
 #endif

-#ifdef PLATFORM_DARWIN
+#if defined(PLATFORM_DARWIN) && !defined(CLOCK_MONOTONIC)
 #error "Platforms without monotonic clocks are not supported!" 
 #define CLOCK_MONOTONIC 0
 #define CLOCK_REALTIME 0
#3

Updated by Markus Griesslehner over 7 years ago

Thanks, now it works for me.

#4

Updated by Jaroslav Kysela over 7 years ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Applied in changeset commit:tvheadend|c0df814a12aa006865c570463467dbab7da2d2e1.

Also available in: Atom PDF