瀏覽代碼

xxhash: do no longer depend on <assert.h> for XXH_STATIC_ASSERT

https://github.com/Cyan4973/xxHash/pull/670

this fixes building borgbackup on FreeBSD 12.x (when using the
bundled xxhash code). otherwise i got "undefined symbol static_assert".
Thomas Waldmann 3 年之前
父節點
當前提交
71e9bd22bf
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      src/borg/algorithms/xxh64/xxhash.h

+ 1 - 2
src/borg/algorithms/xxh64/xxhash.h

@@ -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