Skip to content

Commit

Permalink
Merge pull request #182 from movepointsolutions/0.1.3-dev
Browse files Browse the repository at this point in the history
fix DragonFlyBSD 6.4-RELEASE support
  • Loading branch information
michilumin authored Aug 27, 2024
2 parents 327bfe6 + 21e4372 commit f944b44
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion include/dogecoin/portable_endian.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ LIBDOGECOIN_BEGIN_DECL

#include <sys/endian.h>

#elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
#elif defined(__NetBSD__) || defined(__FreeBSD__)

#include <sys/endian.h>

Expand All @@ -73,6 +73,10 @@ LIBDOGECOIN_BEGIN_DECL
#define be64toh(x) betoh64(x)
#define le64toh(x) letoh64(x)

#elif defined(__DragonFly__)

#include <sys/endian.h>

#elif defined(__WINDOWS__)

#ifndef _MSC_VER
Expand Down
4 changes: 4 additions & 0 deletions include/dogecoin/scrypt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <sys/endian.h>
#else
static inline uint32_t le32dec(const void *pp)
{
const uint8_t *p = (uint8_t const *)pp;
Expand All @@ -39,3 +42,4 @@ static inline void le32enc(void *pp, uint32_t x)
p[3] = (x >> 24) & 0xff;
}
#endif
#endif
2 changes: 2 additions & 0 deletions src/scrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
#define INLINE inline
#endif

#ifndef __DragonFly__
static INLINE uint32_t
be32dec(const void *pp)
{
Expand All @@ -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))))

Expand Down

0 comments on commit f944b44

Please sign in to comment.