diff --git a/include/dogecoin/portable_endian.h b/include/dogecoin/portable_endian.h index 6219d072..788d15ce 100644 --- a/include/dogecoin/portable_endian.h +++ b/include/dogecoin/portable_endian.h @@ -60,7 +60,7 @@ LIBDOGECOIN_BEGIN_DECL #include -#elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) +#elif defined(__NetBSD__) || defined(__FreeBSD__) #include @@ -73,6 +73,10 @@ LIBDOGECOIN_BEGIN_DECL #define be64toh(x) betoh64(x) #define le64toh(x) letoh64(x) +#elif defined(__DragonFly__) + +#include + #elif defined(__WINDOWS__) #ifndef _MSC_VER diff --git a/include/dogecoin/scrypt.h b/include/dogecoin/scrypt.h index 349d2d9e..0708c8de 100644 --- a/include/dogecoin/scrypt.h +++ b/include/dogecoin/scrypt.h @@ -23,6 +23,9 @@ extern void (*scrypt_1024_1_1_256_sp_detected)(const char *input, char *output, #define scrypt_1024_1_1_256_sp(input, output, scratchpad) scrypt_1024_1_1_256_sp_generic((input), (output), (scratchpad)) #endif +#ifdef __DragonFly__ +#include +#else static inline uint32_t le32dec(const void *pp) { const uint8_t *p = (uint8_t const *)pp; @@ -39,3 +42,4 @@ static inline void le32enc(void *pp, uint32_t x) p[3] = (x >> 24) & 0xff; } #endif +#endif diff --git a/src/scrypt.c b/src/scrypt.c index 0da4e8d7..b37211a7 100644 --- a/src/scrypt.c +++ b/src/scrypt.c @@ -52,6 +52,7 @@ #define INLINE inline #endif +#ifndef __DragonFly__ static INLINE uint32_t be32dec(const void *pp) { @@ -71,6 +72,7 @@ be32enc(void *pp, uint32_t x) p[1] = (x >> 16) & 0xff; p[0] = (x >> 24) & 0xff; } +#endif #define ROTL(a, b) (((a) << (b)) | ((a) >> (32 - (b))))