Skip to content

Commit

Permalink
lib/xxhash: do no longer depend on <assert.h> for XXH_STATIC_ASSERT
Browse files Browse the repository at this point in the history
Use `_Static_assert`, which is part of the C11 language.

[ - upstream: Cyan4973/xxHash@6189ecd
  - fixes: buildroot/buildroot@d649bcd
  - It has been a while since the last xxHash release, so just cherry-pick this locally.]

Signed-off-by: Thomas Devoogdt <[email protected]>
  • Loading branch information
ThomasDevoogdt authored and edsiper committed Apr 28, 2023
1 parent 2a6e01b commit de8777b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/xxhash/xxhash.h
Original file line number Diff line number Diff line change
Expand Up @@ -1546,8 +1546,7 @@ static void* XXH_memcpy(void* dest, const void* src, size_t size)
/* note: use after variable declarations */
#ifndef XXH_STATIC_ASSERT
# if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) /* C11 */
# include <assert.h>
# define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { static_assert((c),m); } while(0)
# define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { _Static_assert((c),m); } while(0)
# elif defined(__cplusplus) && (__cplusplus >= 201103L) /* C++11 */
# define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { static_assert((c),m); } while(0)
# else
Expand Down

0 comments on commit de8777b

Please sign in to comment.