diff --git a/src/main.c b/src/main.c index 937b552..075fe50 100644 --- a/src/main.c +++ b/src/main.c @@ -61,8 +61,17 @@ static inline uint64_t htole64(uint64_t x) { return x; } +#elif defined(__linux__) + #include +#elif defined(__APPLE__) + #include + #define htole32(x) OSSwapHostToLittleInt32(x) + #define le32toh(x) OSSwapLittleToHostInt32(x) + #define htole64(x) OSSwapHostToLittleInt64(x) + #define le64toh(x) OSSwapLittleToHostInt64(x) + // Add others as needed #else -#include // On Linux/BSD + #error "Unsupported platform" #endif char *get_current_directory() {