summaryrefslogtreecommitdiffstats
path: root/Utilities
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-02-15 13:56:03 (GMT)
committerBrad King <brad.king@kitware.com>2024-02-15 13:56:03 (GMT)
commit9365455c78cb66c8115d889e73afe0defd7bd670 (patch)
tree259e38f4c88b30bfbbcf536b92f309d18d471f42 /Utilities
parent2ee2aa707437461d07f65cd224f8754946e565cc (diff)
downloadCMake-9365455c78cb66c8115d889e73afe0defd7bd670.zip
CMake-9365455c78cb66c8115d889e73afe0defd7bd670.tar.gz
CMake-9365455c78cb66c8115d889e73afe0defd7bd670.tar.bz2
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
Diffstat (limited to 'Utilities')
-rw-r--r--Utilities/cmzstd/lib/common/compiler.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/Utilities/cmzstd/lib/common/compiler.h b/Utilities/cmzstd/lib/common/compiler.h
index 73f8d01..d07e189 100644
--- a/Utilities/cmzstd/lib/common/compiler.h
+++ b/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>