Skip to content

Fix failures in big endian machines - #8851

Merged
nbolton merged 1 commit into
deskflow:masterfrom
pranavkaruvally:s390x-fix
Aug 12, 2025
Merged

Fix failures in big endian machines#8851
nbolton merged 1 commit into
deskflow:masterfrom
pranavkaruvally:s390x-fix

Conversation

@pranavkaruvally

@pranavkaruvally pranavkaruvally commented Aug 12, 2025

Copy link
Copy Markdown
Contributor

Closes #8850, #8203

This patch fixes the issues that were introduced because of endianness.
So, what this patch does is:

  • Introduced a new WORDS_BIGENDIAN macro in the CMakeLists.txt to check for endianness.
  • With the check with endianness, does a byteswap in doUTF16ToUTF8 and doUTF32ToUTF8
  • In the test UCS2ToUTF8_kUCS2 a wide character is being used which has a size of 4 bytes or 2 bytes depending on the implementation. So, going inside to the code, doUCS2ToUTF8 is expecting the input array to be having 16-bit elements before the reinterpret_cast and that is not the case with operating systems other than Windows. So, I can see that the test case was expecting "h\0e\0l" on Linux (or anything other than Windows). But this is also an endian sensitive testcase as "h\0" in little endian machines will become "\0h" in big endian.

@sithlord48
sithlord48 requested review from nbolton and sithlord48 and removed request for sithlord48 August 12, 2025 13:49
sithlord48

This comment was marked as outdated.

@sithlord48 sithlord48 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small fix, your commit message has to start with fix: .

@sithlord48 sithlord48 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed it

@nbolton

nbolton commented Aug 12, 2025

Copy link
Copy Markdown
Member

Some kind of transient CI deps issue on Windows. Re-running.

@nbolton
nbolton enabled auto-merge (rebase) August 12, 2025 15:49
@nbolton
nbolton merged commit d6b53ea into deskflow:master Aug 12, 2025
78 of 83 checks passed
feishengfei pushed a commit to feishengfei/deskflow that referenced this pull request Sep 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test case failures on s390x

3 participants