Skip to content

Commit

Permalink
devel/xxhash: fix static_assert to _Static_assert
Browse files Browse the repository at this point in the history
This fixes C11+ users of xxhash that do not #include <assert.h>

PR:		265819
Approved by:	portmgr@ (blanket, one-line fix to unbreak py-borgbackup)
MFH:		2022Q3
  • Loading branch information
Thierry Dussuet authored and mandree committed Aug 13, 2022
1 parent ee82cc6 commit 8a4d5e2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion devel/xxhash/Makefile
@@ -1,6 +1,6 @@
PORTNAME= xxhash
PORTVERSION= 0.8.1
PORTREVISION= 1
PORTREVISION= 2
DISTVERSIONPREFIX= v
CATEGORIES= devel

Expand Down
12 changes: 12 additions & 0 deletions devel/xxhash/files/patch-xxhash.h
@@ -0,0 +1,12 @@
--- xxhash.h.orig 2022-08-13 18:58:45.930785000 +0200
+++ xxhash.h 2022-08-13 18:59:08.416809000 +0200
@@ -1546,8 +1546,7 @@
/* 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

0 comments on commit 8a4d5e2

Please sign in to comment.