From 307c02ed698a69763ef1c9c0df4ff24727442118 Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Sat, 29 Mar 2025 12:41:32 +0200 Subject: [PATCH] sysdefs.h: Avoid even with C11 compilers Oracle Developer Studio 12.6 on Solaris 10 claims C11 support in __STDC_VERSION__ and supports _Alignas. However, is missing. We only need alignas, so define it to _Alignas with C11/C17 compilers. If something included later, it shouldn't cause problems. Thanks to Ihsan Dogan for reporting the issue and testing the fix. Fixes: c0e7eaae8d6eef1e313c9d0da20ccf126ec61f38 --- src/common/sysdefs.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/sysdefs.h b/src/common/sysdefs.h index 8e01bd17..b10ffa7c 100644 --- a/src/common/sysdefs.h +++ b/src/common/sysdefs.h @@ -172,7 +172,9 @@ typedef unsigned char _Bool; #if __STDC_VERSION__ >= 202311 // alignas is a keyword in C23. Do nothing. #elif __STDC_VERSION__ >= 201112 -# include + // Oracle Developer Studio 12.6 lacks . + // For simplicity, avoid the header with all C11/C17 compilers. +# define alignas _Alignas #elif defined(__GNUC__) || defined(__clang__) # define alignas(n) __attribute__((__aligned__(n))) #else