Skip to content

Commit

Permalink
Merge pull request #803 from devnexen/clang__assume
Browse files Browse the repository at this point in the history
XXH_ASSUME macro using `__builtin_assume` if supported (clang only fo…
  • Loading branch information
Cyan4973 authored Mar 9, 2023
2 parents 74c416c + 4ff3a1b commit adc4fc8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion xxhash.h
Original file line number Diff line number Diff line change
Expand Up @@ -2091,7 +2091,11 @@ static int XXH_isLittleEndian(void)
# define XXH_UNREACHABLE()
#endif

#define XXH_ASSUME(c) if (!(c)) { XXH_UNREACHABLE(); }
#if XXH_HAS_BUILTIN(__builtin_assume)
# define XXH_ASSUME(c) __builtin_assume(c)
#else
# define XXH_ASSUME(c) if (!(c)) { XXH_UNREACHABLE(); }
#endif

/*!
* @internal
Expand Down

0 comments on commit adc4fc8

Please sign in to comment.