From 4c443d63a9e2236a69d260cb5bc5a68f87bb20d0 Mon Sep 17 00:00:00 2001 From: yomnes0 <127947185+yomnes0@users.noreply.github.com> Date: Fri, 2 Feb 2024 10:50:00 +0100 Subject: [PATCH] [core] Moved declaration of SRT_ATR_ALIGNAS to fix a warning (#2866). --- srtcore/channel.h | 7 ------- srtcore/srt_attr_defs.h | 8 ++++++++ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/srtcore/channel.h b/srtcore/channel.h index 6df7ec0ce..e09b13fd9 100644 --- a/srtcore/channel.h +++ b/srtcore/channel.h @@ -49,13 +49,6 @@ written by modified by Haivision Systems Inc. *****************************************************************************/ -#if HAVE_CXX11 -#define SRT_ATR_ALIGNAS(n) alignas(n) -#elif HAVE_GCC -#define SRT_ATR_ALIGNAS(n) __attribute__((aligned(n))) -#else -#define SRT_ATR_ALIGNAS(n) -#endif #ifndef INC_SRT_CHANNEL_H #define INC_SRT_CHANNEL_H diff --git a/srtcore/srt_attr_defs.h b/srtcore/srt_attr_defs.h index 84daabeb1..85ea9f96d 100644 --- a/srtcore/srt_attr_defs.h +++ b/srtcore/srt_attr_defs.h @@ -31,6 +31,14 @@ used by SRT library internally. #define ATR_DEPRECATED #endif +#if HAVE_CXX11 +#define SRT_ATR_ALIGNAS(n) alignas(n) +#elif HAVE_GCC +#define SRT_ATR_ALIGNAS(n) __attribute__((aligned(n))) +#else +#define SRT_ATR_ALIGNAS(n) +#endif + #if defined(__cplusplus) && __cplusplus > 199711L #define HAVE_CXX11 1 // For gcc 4.7, claim C++11 is supported, as long as experimental C++0x is on,