Re: "clock_gettime" error on macOS

From: Alexandre Ratchov <alex_at_caoua.org>
Date: Thu Jul 20 2017 - 13:22:30 CEST
On Sun, Jun 25, 2017 at 10:08:13PM +0200, Gustaf Tamm wrote:
> Hello, I'm trying to install midish, according to the manual. When I run the make I get this error:
> 
> cc   -DUSE_RAW -c mdep.c
> mdep.c:68:9: warning: 'CLOCK_MONOTONIC' macro redefined [-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
>         ^
> mdep.c:71:1: error: conflicting types for 'clock_gettime'
> clock_gettime(int which, struct timespec *ts)
> ^
> /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);
>     ^
> 1 warning and 1 error generated.
> make: *** [mdep.o] Error 1
> 
> Any solution, is there something wrong with my machine, or is it your code? Thanks.

Hi,

Sorry for replying so late.  New OSX releses have the
clock_gettime() function while midish is assumuming it's not
available; in turn it defines its own function, which causes
conflicts.

I couldn't find a recent OS X to test, but I think the fix that
just went in should work on your system.  Let me know if this is OK
(the fix is in the new 1.2.1 release or the snapshot).

-- Alex
Received on Thu, 20 Jul 2017 13:22:30 +0200

This archive was generated by hypermail 2.1.8 : Wed Nov 08 2017 - 16:32:30 CET