fcitx / libime

40 stars 21 forks source link

macOS下编译提示:fatal error: 'sys/endian.h' file not found #42

Closed SleepBoy closed 1 year ago

SleepBoy commented 1 year ago

在macOS下没有sys/endian.h,应该将:

else

include <sys/endian.h>

改为:

elif defined(APPLE)

include <libkern/OSByteOrder.h>

define htobe16(x) OSSwapHostToBigInt16(x)

define htole16(x) OSSwapHostToLittleInt16(x)

define be16toh(x) OSSwapBigToHostInt16(x)

define le16toh(x) OSSwapLittleToHostInt16(x)

define htobe32(x) OSSwapHostToBigInt32(x)

define htole32(x) OSSwapHostToLittleInt32(x)

define be32toh(x) OSSwapBigToHostInt32(x)

define le32toh(x) OSSwapLittleToHostInt32(x)

define htobe64(x) OSSwapHostToBigInt64(x)

define htole64(x) OSSwapHostToLittleInt64(x)

define be64toh(x) OSSwapBigToHostInt64(x)

define le64toh(x) OSSwapLittleToHostInt64(x)

else

include <sys/endian.h>

即可编译通过