wrapping ntohll in ifndef for mac

This commit is contained in:
Jörg Hösel 2015-09-29 15:32:36 +02:00
parent cdd490ee02
commit b3239d25a1

View File

@ -36,12 +36,14 @@ typedef struct {
PowArgs* pow_args; PowArgs* pow_args;
} ThreadArgs; } ThreadArgs;
#ifndef ntohll
inline uint64_t ntohll(uint64_t x) { inline uint64_t ntohll(uint64_t x) {
return ( return (
((uint64_t)(ntohl( (unsigned int)((x << 32) >> 32) )) << 32) | ((uint64_t)(ntohl( (unsigned int)((x << 32) >> 32) )) << 32) |
ntohl( ((unsigned int)(x >> 32)) ) ntohl( ((unsigned int)(x >> 32)) )
); );
} }
#endif
// Set POW computation result in a thread-safe way. // Set POW computation result in a thread-safe way.
void set_result(PowArgs* pow_args, PowResult res, uint64_t nonce) { void set_result(PowArgs* pow_args, PowResult res, uint64_t nonce) {