@@ -16,12 +16,6 @@ extern "C" {
1616#include < simplicity/elements/exec.h>
1717#include < simplicity/errorCodes.h>
1818}
19- // ELEMENTS: Macos compat for htole32 and htole64
20- #if defined(__APPLE__)
21- #include < libkern/OSByteOrder.h>
22- #define htole32 (x ) OSSwapHostToLittleInt32(x)
23- #define htole64 (x ) OSSwapHostToLittleInt64(x)
24- #endif
2519
2620typedef std::vector<unsigned char > valtype;
2721
@@ -90,13 +84,13 @@ static inline int64_t read_le8_signed(const unsigned char* ptr)
9084
9185static inline void push4_le (std::vector<valtype>& stack, uint32_t v)
9286{
93- uint32_t v_le = htole32 (v);
87+ uint32_t v_le = htole32_internal (v);
9488 stack.emplace_back (reinterpret_cast <unsigned char *>(&v_le), reinterpret_cast <unsigned char *>(&v_le) + sizeof (v_le));
9589}
9690
9791static inline void push8_le (std::vector<valtype>& stack, uint64_t v)
9892{
99- uint64_t v_le = htole64 (v);
93+ uint64_t v_le = htole64_internal (v);
10094 stack.emplace_back (reinterpret_cast <unsigned char *>(&v_le), reinterpret_cast <unsigned char *>(&v_le) + sizeof (v_le));
10195}
10296
@@ -1669,7 +1663,7 @@ bool EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript&
16691663 hasher.Write (vchSeed.data (), vchSeed.size ());
16701664 do {
16711665 if (nHashIndex >= 3 ) {
1672- uint64_t le_counter = htole64 (nCounter);
1666+ uint64_t le_counter = htole64_internal (nCounter);
16731667 CSHA256 (hasher).Write ((const unsigned char *)&le_counter, sizeof (nCounter)).Finalize (vchHash.data ());
16741668 nHashIndex = 0 ;
16751669 nCounter++;
0 commit comments