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

endian check from runtime to compile time #2668

Merged
merged 1 commit into from
Jun 29, 2023
Merged

endian check from runtime to compile time #2668

merged 1 commit into from
Jun 29, 2023

Conversation

neheb
Copy link
Collaborator

@neheb neheb commented Jun 29, 2023

No description provided.

@kevinbackhouse
Copy link
Collaborator

We're not on C++20 yet, are we? It's a shame we can't use std::endian::native.

@ghost
Copy link

ghost commented Jun 29, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@codecov
Copy link

codecov bot commented Jun 29, 2023

Codecov Report

Merging #2668 (870ea3a) into main (a89c02f) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #2668      +/-   ##
==========================================
- Coverage   63.92%   63.92%   -0.01%     
==========================================
  Files         103      103              
  Lines       22306    22305       -1     
  Branches    10795    10795              
==========================================
- Hits        14259    14258       -1     
  Misses       5826     5826              
  Partials     2221     2221              
Impacted Files Coverage Δ
src/image.cpp 70.19% <100.00%> (-0.06%) ⬇️

@neheb
Copy link
Collaborator Author

neheb commented Jun 29, 2023

We're not on C++20 yet, are we? It's a shame we can't use std::endian::native.

std::endian requires the minimum compiler to be bumped. Exiv2 can still be compiled with gcc7.

@neheb neheb merged commit e4a4791 into Exiv2:main Jun 29, 2023
109 checks passed
@neheb neheb deleted the en branch June 29, 2023 21:40
@Ryanf55
Copy link
Contributor

Ryanf55 commented Jun 29, 2023

gcc7

FYI the oldest non-EOL ubuntu version ships with 9.3.0. https://packages.ubuntu.com/focal/devel/gcc

@kmilos
Copy link
Collaborator

kmilos commented Jun 30, 2023

Backport to 0.28.x?

@kmilos
Copy link
Collaborator

kmilos commented Jun 30, 2023

Also, might be better to use compiler defined __BYTE_ORDER__ and __ORDER_BIG_ENDIAN__ macros rather than some header defined macros that are not standard?

@neheb
Copy link
Collaborator Author

neheb commented Jun 30, 2023

That would only help with MinGW AFAIK. ORDER_BIG_ENDIAN is a GCC macro.

@kmilos
Copy link
Collaborator

kmilos commented Jun 30, 2023

And Clang as well, at least.

Where does __ORDER_BIG_ENDIAN come from?

@neheb
Copy link
Collaborator Author

neheb commented Jun 30, 2023

GCC and clang.

@kmilos
Copy link
Collaborator

kmilos commented Jun 30, 2023

My GCC and Clang have only the variants with two underscores at the end 🤷

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.

4 participants