From 1326868a01fcb49569f87f64d336d15bee485ce6 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Mon, 13 Sep 2021 11:48:21 +0200 Subject: [PATCH] Do not use [[maybe_unused]] for data members with GCC GCC complains on that with -Wattributes --- src/rtsp/BasicRTSPOnlySubsession.hh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/rtsp/BasicRTSPOnlySubsession.hh b/src/rtsp/BasicRTSPOnlySubsession.hh index afaad4955..f68484013 100644 --- a/src/rtsp/BasicRTSPOnlySubsession.hh +++ b/src/rtsp/BasicRTSPOnlySubsession.hh @@ -80,6 +80,12 @@ public: unsigned char rtpChannelId, rtcpChannelId; }; +#ifdef __clang__ +#define MAYBE_UNUSED_ATTRIBUTE [[maybe_unused]] +#else +#define MAYBE_UNUSED_ATTRIBUTE // GCC complains if [[maybe_used]] is used there +#endif + class BasicRTSPOnlySubsession: public ServerMediaSubsession { public: @@ -131,8 +137,8 @@ private: void setSDPLines(); - [[maybe_unused]] Boolean fReuseFirstSource; - [[maybe_unused]] void* fLastStreamToken; + MAYBE_UNUSED_ATTRIBUTE Boolean fReuseFirstSource; + MAYBE_UNUSED_ATTRIBUTE void* fLastStreamToken; char fCNAME[100]; struct module *fmod; rtps_types_t avType;