Skip to content

Commit

Permalink
Util: Improve host endian detection for older GCCs.
Browse files Browse the repository at this point in the history
Co-authored-by: John-Mark Bell <[email protected]>
  • Loading branch information
tlsa and jmb202 committed Mar 24, 2022
1 parent d3a8f34 commit 5b99bd9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
*/
static inline bool cyaml__host_is_little_endian(void)
{
static const uint16_t test = 1;
const uint16_t test = 1;

return ((const uint8_t *) &test)[0] == 1;
return ((const uint8_t *) &test)[0];
}

/**
Expand Down

0 comments on commit 5b99bd9

Please sign in to comment.