Skip to content

Commit

Permalink
Fix detection of endianness
Browse files Browse the repository at this point in the history
The non-underscored constants in endian.h only if the __USE_MISC is
defined for some reason. This fixes the failing tests on s390x during
the build in copr.

Fixes #96

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
  • Loading branch information
Jakuje authored and simo5 committed Nov 11, 2022
1 parent e33e72a commit 3e13884
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/store.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ P11PROV_KEY *p11prov_object_get_key(P11PROV_OBJ *obj)
* Src and Dest, can be the same area, but not partially
* overlapping memory areas */

#if BYTE_ORDER == LITTLE_ENDIAN
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define WITH_FIXED_BUFFER(src, ptr) \
unsigned char fix_##src[src->ulValueLen]; \
byteswap_buf(src->pValue, fix_##src, src->ulValueLen); \
Expand Down
2 changes: 1 addition & 1 deletion src/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ bool cyclewait_with_timeout(uint64_t max_wait, uint64_t interval,

void byteswap_buf(unsigned char *src, unsigned char *dest, size_t len)
{
#if BYTE_ORDER == LITTLE_ENDIAN
#if __BYTE_ORDER == __LITTLE_ENDIAN
int s = 0;
int e = len - 1;
unsigned char sb;
Expand Down

0 comments on commit 3e13884

Please sign in to comment.