1
0
ミラー元 https://git.tukaani.org/xz.git 前回の同期 2025-07-01 18:06:37 +00:00

sysdefs.h: Avoid <stdalign.h> even with C11 compilers

Oracle Developer Studio 12.6 on Solaris 10 claims C11 support in
__STDC_VERSION__ and supports _Alignas. However, <stdalign.h> is missing.
We only need alignas, so define it to _Alignas with C11/C17 compilers.
If something included <stdalign.h> later, it shouldn't cause problems.

Thanks to Ihsan Dogan for reporting the issue and testing the fix.

Fixes: c0e7eaae8d6eef1e313c9d0da20ccf126ec61f38
このコミットが含まれているのは:
Lasse Collin 2025-03-29 12:41:32 +02:00
コミット 307c02ed69
この署名に対応する既知のキーがデータベースに存在しません
GPGキーID: 38EE757D69184620

ファイルの表示

@ -172,7 +172,9 @@ typedef unsigned char _Bool;
#if __STDC_VERSION__ >= 202311 #if __STDC_VERSION__ >= 202311
// alignas is a keyword in C23. Do nothing. // alignas is a keyword in C23. Do nothing.
#elif __STDC_VERSION__ >= 201112 #elif __STDC_VERSION__ >= 201112
# include <stdalign.h> // Oracle Developer Studio 12.6 lacks <stdalign.h>.
// For simplicity, avoid the header with all C11/C17 compilers.
# define alignas _Alignas
#elif defined(__GNUC__) || defined(__clang__) #elif defined(__GNUC__) || defined(__clang__)
# define alignas(n) __attribute__((__aligned__(n))) # define alignas(n) __attribute__((__aligned__(n)))
#else #else