From 91658ababd0f3d902c3c40673640b6a8f90c648c Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Sat, 11 Aug 2018 12:35:15 -0400 Subject: Un-break builds on MacOS. timersub() is a macro on *BSD, including MacOS, so redefinition as a function in hashsig test code was breaking the whole build. Clang has other comments on the hashsig code, leaving those for Paul. --- tests/test-rpc_hashsig.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/test-rpc_hashsig.c b/tests/test-rpc_hashsig.c index 00728c3..8cd2897 100644 --- a/tests/test-rpc_hashsig.c +++ b/tests/test-rpc_hashsig.c @@ -53,6 +53,8 @@ #include /* not included in my glibc, sigh... */ +/* But it's a macro on *BSD including MacOS so don't conflict with that. */ +#ifndef timersub void timersub(struct timeval *a, struct timeval *b, struct timeval *res) { res->tv_sec = a->tv_sec - b->tv_sec; @@ -66,6 +68,7 @@ void timersub(struct timeval *a, struct timeval *b, struct timeval *res) ++res->tv_sec; } } +#endif static int debug = 0; static int info = 0; -- cgit v1.2.3