Skip to content

Conversation

nekuz0r
Copy link

@nekuz0r nekuz0r commented Nov 19, 2020

Mac OS X doesn't provide endian.h.
It's only required for the be32toh and htobe32 utility functions.
Mac OS X provides similare functions in libkern/OSByteOrder.h.

Respectively OSSwapHostToBigInt32 for htobe32 and OSSwapBigToHostInt32 for be32toh.

This adds a preprocessor condition to include endian.h on non apple system and to include libkern/OSByteOrder.h as well as defining to macro to provide htobe32 and be32toh on apple plateform.

Mac OS X doesn't provide `endian.h`.
It's only required for the `be32toh` and `htobe32` utility functions.
Mac OS X provides similare functions in `libkern/OSByteOrder.h`.

Respectively `OSSwapHostToBigInt32` for `htobe32` and `OSSwapBigToHostInt32` for `be32toh`.

This adds a preprocessor condition to include `endian.h` on non apple system and to include `libkern/OSByteOrder.h` as well as defining to macro to provide `htobe32` and `be32toh` on apple plateform.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant