Skip to content

Commit

Permalink
Merge pull request #201 from KatrinJo/main
Browse files Browse the repository at this point in the history
Fix compiler error
  • Loading branch information
alexlarsson authored Sep 26, 2023
2 parents 6419d8c + 6bd6a9d commit afd88bf
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions libcomposefs/lcfs-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,37 +62,43 @@

#define lcfs_u16_to_file(v) \
({ \
_Static_assert(sizeof(v) == sizeof(uint16_t)); \
_Static_assert(sizeof(v) == sizeof(uint16_t), \
"Size of v is not equal to size of uint16_t"); \
htole16(v); \
})

#define lcfs_u32_to_file(v) \
({ \
_Static_assert(sizeof(v) == sizeof(uint32_t)); \
_Static_assert(sizeof(v) == sizeof(uint32_t), \
"Size of v is not equal to size of uint32_t"); \
htole32(v); \
})

#define lcfs_u64_to_file(v) \
({ \
_Static_assert(sizeof(v) == sizeof(uint64_t)); \
_Static_assert(sizeof(v) == sizeof(uint64_t), \
"Size of v is not equal to size of uint64_t"); \
htole64(v); \
})

#define lcfs_u16_from_file(v) \
({ \
_Static_assert(sizeof(v) == sizeof(uint16_t)); \
_Static_assert(sizeof(v) == sizeof(uint16_t), \
"Size of v is not equal to size of uint16_t"); \
le16toh(v); \
})

#define lcfs_u32_from_file(v) \
({ \
_Static_assert(sizeof(v) == sizeof(uint32_t)); \
_Static_assert(sizeof(v) == sizeof(uint32_t), \
"Size of v is not equal to size of uint32_t"); \
le32toh(v); \
})

#define lcfs_u64_from_file(v) \
({ \
_Static_assert(sizeof(v) == sizeof(uint64_t)); \
_Static_assert(sizeof(v) == sizeof(uint64_t), \
"Size of v is not equal to size of uint64_t"); \
le64toh(v); \
})

Expand Down

0 comments on commit afd88bf

Please sign in to comment.