shared: add typedefs for integers for different endianness

Kernel uses such typedefs (__le32) and systemd too (le32_t).
As we don't want to rely on systemd headers in our code
base, let's also define them.

They have of course very little effect beside making it clearer to
the reviewer that a certain variable is not supposed to be in native
endianness.
This commit is contained in:
Thomas Haller 2020-09-24 13:30:39 +02:00
parent b019950eaf
commit f74b7718b3
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -44,6 +44,23 @@
/*****************************************************************************/
#ifdef __CHECKER__
#define _nm_bitwise __attribute__((__bitwise__))
#define _nm_force __attribute__((__force__))
#else
#define _nm_bitwise
#define _nm_force
#endif
typedef uint16_t _nm_bitwise nm_le16_t;
typedef uint16_t _nm_bitwise nm_be16_t;
typedef uint32_t _nm_bitwise nm_le32_t;
typedef uint32_t _nm_bitwise nm_be32_t;
typedef uint64_t _nm_bitwise nm_le64_t;
typedef uint64_t _nm_bitwise nm_be64_t;
/*****************************************************************************/
#ifdef thread_local
#define _nm_thread_local thread_local
/*