pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/56752: devel/xxhash fails to compile under Solaris 10/GCC 8



>Number:         56752
>Category:       pkg
>Synopsis:       devel/xxhash fails to compile under Solaris 10/GCC 8
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 14 19:00:00 +0000 2022
>Originator:     Claes Nästén
>Release:        trunk 2022-03-13
>Organization:
>Environment:
SunOS 5.10 sun4v sparc SUNW,SPARC-Enterprise-T2000
>Description:
Building devel/xxhash with GCC 8 under Solaris 10 fails due to static_assert define is missing from system headers.

Presumably this will fail on other legacy systems with a more recent compiler.
>How-To-Repeat:
Build devel/xxhash under Solaris 10 using GCC8
>Fix:
$NetBSD$

Fall back to _Static_assert if static_assert is missing from headers, for
systems with new compilers and old headers.

--- xxhash.h.orig       2021-11-29 18:34:10.000000000 +0000
+++ xxhash.h
@@ -1547,7 +1547,11 @@ static void* XXH_memcpy(void* dest, cons
 #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)
+#    ifdef static_assert
+#      define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { static_assert((c),m); } while(0)
+#    else
+#      define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { _Static_assert((c),m); } while(0)
+#    endif
 #  elif defined(__cplusplus) && (__cplusplus >= 201103L)            /* C++11 */
 #    define XXH_STATIC_ASSERT_WITH_MESSAGE(c,m) do { static_assert((c),m); } while(0)
 #  else



Home | Main Index | Thread Index | Old Index