Add-in development tools for fx-9860G and fx-CG 50, to use with GCC and gint.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

endianness.h 820B

123456789101112131415161718192021222324252627282930313233
  1. //---
  2. // Cross-platform endianness conversion. (seriously?)
  3. //---
  4. #ifndef FX_ENDIANNESS
  5. #define FX_ENDIANNESS
  6. #if defined(__APPLE__)
  7. #include <libkern/OSByteOrder.h>
  8. #define htobe16(x) OSSwapHostToBigInt16(x)
  9. #define htole16(x) OSSwapHostToLittleInt16(x)
  10. #define be16toh(x) OSSwapBigToHostInt16(x)
  11. #define le16toh(x) OSSwapLittleToHostInt16(x)
  12. #define htobe32(x) OSSwapHostToBigInt32(x)
  13. #define htole32(x) OSSwapHostToLittleInt32(x)
  14. #define be32toh(x) OSSwapBigToHostInt32(x)
  15. #define le32toh(x) OSSwapLittleToHostInt32(x)
  16. #define htobe64(x) OSSwapHostToBigInt64(x)
  17. #define htole64(x) OSSwapHostToLittleInt64(x)
  18. #define be64toh(x) OSSwapBigToHostInt64(x)
  19. #define le64toh(x) OSSwapLittleToHostInt64(x)
  20. #elif defined(__linux__)
  21. #include <sys/types.h>
  22. #endif
  23. #endif /* FX_ENDIANNESS */