Skip to content

Commit

Permalink
fix windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
aystarik committed Aug 30, 2023
1 parent a82cbe3 commit 659a310
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/gowin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,17 @@ bool Gowin::send_command(uint8_t cmd)
#include <libkern/OSByteOrder.h>
#define le32toh(x) OSSwapLittleToHostInt32(x)
#define htole32(x) OSSwapHostToLittleInt32(x)
#elif (defined(_WIN16) || defined(_WIN32) || defined(_WIN64)) || defined(__WINDOWS__)
#if BYTE_ORDER == LITTLE_ENDIAN
#if defined(_MSC_VER)
#include <stdlib.h>
#define htole32(x) (x)
#define le32toh(x) (x)
#elif defined(__GNUC__) || defined(__clang__)
#define htole32(x) (x)
#define le32toh(x) (x)
#endif
#endif
#endif

uint32_t Gowin::readReg32(uint8_t cmd)
Expand Down

0 comments on commit 659a310

Please sign in to comment.