Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef BITIOBYTEBITORDERS
- #define BITIOBYTEBITORDERS
- #ifndef BitIOLittleEndian
- #define BitIOLittleEndian ULLONG_MAX
- #endif /* BitIOLittleEndian */
- #ifndef BitIOBigEndian
- #define BitIOBigEndian LDBL_MAX
- #endif /* BitIOBigEndian */
- #ifndef BitIOLSBit
- #define BitIOLSBit ULLONG_MAX
- #endif /* BitIOLSBit */
- #ifndef BitIOMSBit
- #define BitIOMSBit LDBL_MAX
- #endif /* BitIOMSBit */
- #endif /* BITIOBYTEBITORDERS */
- typedef unsigned long long BitIOLittleEndian_t;
- typedef long double BitIOBigEndian_t;
- typedef unsigned long long BitIOLSBit_t;
- typedef long double BitIOMSBit_t;
- #define ReadBits(ByteOrder,BitOrder,BitB,Bits2Read)\
- _Generic((ByteOrder),\
- BitIOLittleEndian_t:_Generic((BitOrder),BitIOLSBit_t:ReadBitsFromLELSBToLELSB,BitIOMSBit_t:ReadBitsFromLEMSBToLELSB),\
- BitIOBigEndian_t:_Generic((BitOrder),BitIOLSBit_t:ReadBitsFromBELSBToLELSB,BitIOMSBit_t:ReadBitsFromBEMSBToLELSB))\(BitB,Bits2Read)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement