From 123058b587c1cc38a6a6d2fe0073f532d7936347 Mon Sep 17 00:00:00 2001 From: Paul Sheppard Date: Thu, 28 Jun 2012 11:02:03 -0700 Subject: [PATCH] Add macro roundl for compilers without said function. --- miner.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/miner.h b/miner.h index 57fa774f..1e42c6fc 100644 --- a/miner.h +++ b/miner.h @@ -159,6 +159,10 @@ void *alloca (size_t); #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) #endif +#ifndef roundl +#define roundl(x) (long double)((long long)((x==0)?0.0:((x)+((x)>0)?0.5:-0.5))) +#endif + enum alive { LIFE_WELL, LIFE_SICK,