Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: Improve check for endianness when using Visual Studio. #998

Merged
merged 1 commit into from
Feb 12, 2024

Conversation

RandomInEqualities
Copy link
Contributor

@RandomInEqualities RandomInEqualities commented Feb 4, 2024

Hi,

I noticed that ´__BYTE_ORDER__´ was not defined when compiling with visual studio, causing it to detect everything as little endian. This adds a cmake build check for endianness, if you think it makes sense to do this.

Visual studio does not define ´__BYTE_ORDER__´ so all architectures were detected as LITTLE_ENDIAN since both ´__BYTE_ORDER__´ and ´__ORDER_LITTLE_ENDIAN__´ would evaluate to 0 and compare equal. This updates the checks to use CMakes detection of endianness, with a hard error, if this also fails.

CMakeLists.txt Outdated Show resolved Hide resolved
Visual studio does not define __BYTE_ORDER__ so all architectures
were detected as LITTLE_ENDIAN since both __BYTE_ORDER__ and
__ORDER_LITTLE_ENDIAN__ would evaluate to 0 and compare equal. This
updates the checks to use CMakes detection of endianness, with a hard
error, if this also fails.
@busterb busterb self-assigned this Feb 12, 2024
@busterb busterb merged commit db3ab16 into libressl:master Feb 12, 2024
35 checks passed
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.

3 participants