Browse Source

zstd: Fix compilation with Oracle Studio compiler on Solaris

The compiler does not have `<stdalign.h>`, but does have `_Alignof`:

* https://docs.oracle.com/cd/E77782_01/html/E77788/gnxfh.html#OSSCGgnyfx
Brad King 1 year ago
parent
commit
9365455c78
1 changed files with 4 additions and 0 deletions
  1. 4 0
      Utilities/cmzstd/lib/common/compiler.h

+ 4 - 0
Utilities/cmzstd/lib/common/compiler.h

@@ -265,6 +265,10 @@
  * due to a limitation in the kernel source generator */
 #  define ZSTD_ALIGNOF(T) __alignof(T)
 
+# elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+/* Oracle Studio */
+#  define ZSTD_ALIGNOF(T) _Alignof(T)
+
 # elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
 /* C11 support */
 #  include <stdalign.h>