Skip to content

Commit acad7bb

Browse files
committed
build: replace big/little endianess check to WORDS_BIGENDIAN macro
1 parent fc1aeac commit acad7bb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

modules/surface_matching/src/hash_murmur86.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
* with support for progressive processing.
99
*/
1010

11+
#include "cvconfig.h"
12+
1113
/* ------------------------------------------------------------------------- */
1214
/* Determine what native type to use for uint32_t */
1315

@@ -89,10 +91,9 @@ void hashMurmurx86 ( const void * key, const int len, const uint seed, void * ou
8991
#endif
9092

9193
/* Now find best way we can to READ_UINT32 */
92-
#if (defined(_M_IX86) || defined(__i386__) || defined(__i386) || defined(i386)) \
93-
|| (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
94+
#ifndef WORDS_BIGENDIAN
9495
# define READ_UINT32(ptr) (*((uint32_t*)(ptr)))
95-
#elif (defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
96+
#elif defined(WORDS_BIGENDIAN)
9697
&& defined(__GNUC__) && (__GNUC__>4 || (__GNUC__==4 && __GNUC_MINOR__>=3))
9798
# define READ_UINT32(ptr) (__builtin_bswap32(*((uint32_t*)(ptr))))
9899
#endif

0 commit comments

Comments
 (0)