File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010
1111#pragma once
1212
13- #include <endian.h>
1413#include <errno.h>
1514#include <string.h>
1615
16+ #if defined(_WIN32 ) || defined(_WIN64 )
17+ #if defined(__BYTE_ORDER__ ) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
18+ #define htobe16 (x ) (x)
19+ #define htobe32 (x ) (x)
20+ #define htobe64 (x ) (x)
21+ #define htole16 (x ) __builtin_bswap16(x)
22+ #define htole32 (x ) __builtin_bswap32(x)
23+ #define htole64 (x ) __builtin_bswap64(x)
24+ #define le16toh (x ) __builtin_bswap16(x)
25+ #define le32toh (x ) __builtin_bswap32(x)
26+ #define le64toh (x ) __builtin_bswap64(x)
27+ #else
28+ /* Little-endian (most common case for Windows) */
29+ #define htobe16 (x ) __builtin_bswap16(x)
30+ #define htobe32 (x ) __builtin_bswap32(x)
31+ #define htobe64 (x ) __builtin_bswap64(x)
32+ #define htole16 (x ) (x)
33+ #define htole32 (x ) (x)
34+ #define htole64 (x ) (x)
35+ #define le16toh (x ) (x)
36+ #define le32toh (x ) (x)
37+ #define le64toh (x ) (x)
38+ #endif
39+ #else
40+ #include <endian.h>
41+ #endif
42+
1743#include <nvme/ioctl.h>
1844#include <nvme/types.h>
1945
You can’t perform that action at this time.
0 commit comments