CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
Ardupilot

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: Ardupilot/ardupilot
Path: blob/master/libraries/AP_Common/missing/byteswap.h
Views: 1799
1
#if defined(HAVE_BYTESWAP_H) && HAVE_BYTESWAP_H
2
#include_next <byteswap.h>
3
#else
4
5
#include <inttypes.h>
6
7
/* minimal version defining only the macros we need in our codebase */
8
9
static inline uint16_t __bswap_16(uint16_t u)
10
{
11
return (uint16_t) __builtin_bswap16(u);
12
}
13
14
static inline uint32_t __bswap_32(uint32_t u)
15
{
16
return (uint32_t) __builtin_bswap32(u);
17
}
18
19
static inline uint64_t __bswap_64(uint64_t u)
20
{
21
return (uint64_t) __builtin_bswap64(u);
22
}
23
24
#endif
25
26