File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 5151#include < limits>
5252#include < set>
5353
54+ #ifdef __cpp_lib_endian
55+ #include < bit>
56+ #endif
57+
5458// *****************************************************************************
5559namespace {
5660using namespace Exiv2 ;
@@ -168,7 +172,9 @@ bool Image::isPrintICC(uint16_t type, Exiv2::PrintStructureOption option) {
168172}
169173
170174bool Image::isBigEndianPlatform () {
171- #ifdef __LITTLE_ENDIAN__
175+ #ifdef __cpp_lib_endian
176+ return std::endian::native == std::endian::big;
177+ #elif defined(__LITTLE_ENDIAN__)
172178 return false ;
173179#elif defined(__BIG_ENDIAN__)
174180 return true ;
@@ -188,7 +194,9 @@ bool Image::isBigEndianPlatform() {
188194#endif
189195}
190196bool Image::isLittleEndianPlatform () {
191- #ifdef __LITTLE_ENDIAN__
197+ #ifdef __cpp_lib_endian
198+ return std::endian::native == std::endian::little;
199+ #elif defined(__LITTLE_ENDIAN__)
192200 return true ;
193201#else
194202 return !isBigEndianPlatform ();
You can’t perform that action at this time.
0 commit comments