mirror of
https://github.com/apple/swift-nio
synced 2026-11-29 05:24:21 +00:00
[Windows] Windows has endianess too (#3317)
TIL there is an `endian.h` on Linux and macOS that is imported through `<sys/types.h>` on Linux and Apple platforms. Apparently such a header file does not exist in Windows land. For this reason we need to define the macros that we need here ourselves.
This commit is contained in:
1 parent
d6609623dd
commit
06f236d37a
1 file changed
+10
Vendored
+10
@@ -56,6 +56,16 @@
|
||||
#include <sys/endian.h>
|
||||
#elif defined(__linux__) || defined(__APPLE__) || defined(__wasm32__)
|
||||
#include <sys/types.h>
|
||||
#elif defined(_WIN32) || defined(_WIN64)
|
||||
#ifndef LITTLE_ENDIAN
|
||||
#define LITTLE_ENDIAN 1234
|
||||
#endif
|
||||
#ifndef BIG_ENDIAN
|
||||
#define BIG_ENDIAN 4321
|
||||
#endif
|
||||
#ifndef BYTE_ORDER
|
||||
#define BYTE_ORDER LITTLE_ENDIAN
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user