| 45 | |
| 46 | template <typename T> |
| 47 | constexpr char *EncodeFixed(char *buf, T value) { |
| 48 | if constexpr (IsLittleEndian()) { |
| 49 | value = BitSwap(value); |
| 50 | } |
| 51 | __builtin_memcpy(buf, &value, sizeof(value)); |
| 52 | return buf + sizeof(value); |
| 53 | } |
| 54 | |
| 55 | inline char *EncodeFixed8(char *buf, uint8_t value) { return EncodeFixed(buf, value); } |
| 56 | inline char *EncodeFixed16(char *buf, uint16_t value) { return EncodeFixed(buf, value); } |
no test coverage detected