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

Cleanup endian checks #36

Closed
schwehr opened this issue Mar 14, 2021 · 3 comments · Fixed by #91
Closed

Cleanup endian checks #36

schwehr opened this issue Mar 14, 2021 · 3 comments · Fixed by #91
Assignees

Comments

@schwehr
Copy link
Member

schwehr commented Mar 14, 2021

There should be only on place that checks for endian and it should be at compile time.

What do autoconf and CMake say about endianness?

  • AC_C_BIGENDIAN
  • TEST_BIG_ENDIAN

https://stackoverflow.com/questions/2100331/c-macro-definition-to-determine-big-endian-or-little-endian-machine

http://esr.ibiblio.org/?p=5095

@schwehr schwehr self-assigned this Mar 14, 2021
@thbeu
Copy link
Contributor

thbeu commented Jan 22, 2024

What is your preferred way to fix this? Is a global variable bigEndian required?

I used this kind of "static" endian detection in matio which is working for years:

https://github.com/tbeu/matio/blob/0884b80a7ee5783b6193d7e2c58f997d121d3245/src/mat4.c#L153-L173

@thbeu
Copy link
Contributor

thbeu commented Jan 28, 2024

@schwehr I see that you self-assigned this issue, but nevertheless I now created #91.

@schwehr
Copy link
Member Author

schwehr commented Jan 28, 2024

Awesome! I ran out of steam working on shapelib and I appreciate you doing #91.

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 a pull request may close this issue.

2 participants