Skip to content

Commit

Permalink
[core] Fixed warning on SRT_ATTR_REQUIRES.
Browse files Browse the repository at this point in the history
SAL supports only one argument, added SRT_ATTR_REQUIRES2.
  • Loading branch information
maxsharabayko committed Jun 10, 2022
1 parent 04b7c00 commit 8d1643e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion srtcore/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ class CUDT

/// @brief Drop packets too late to be delivered if any.
/// @returns the number of packets actually dropped.
SRT_ATTR_REQUIRES(m_RecvAckLock, m_StatsLock)
SRT_ATTR_REQUIRES2(m_RecvAckLock, m_StatsLock)
int sndDropTooLate();

/// @bried Allow packet retransmission.
Expand Down
2 changes: 1 addition & 1 deletion srtcore/packetfilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class PacketFilter
// Things being done:
// 1. The filter is individual, so don't copy it. Set NULL.
// 2. This will be configued anyway basing on possibly a new rule set.
PacketFilter(const PacketFilter& source SRT_ATR_UNUSED): m_filter(), m_sndctlpkt(0), m_unitq() {}
PacketFilter(const PacketFilter& source SRT_ATR_UNUSED): m_filter(), m_parent(), m_sndctlpkt(0), m_unitq() {}

// This function will be called by the parent CUDT
// in appropriate time. It should select appropriate
Expand Down
4 changes: 4 additions & 0 deletions srtcore/srt_attr_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ used by SRT library internally.
#define SRT_ATTR_ACQUIRED_BEFORE(...)
#define SRT_ATTR_ACQUIRED_AFTER(...)
#define SRT_ATTR_REQUIRES(expr) _Requires_lock_held_(expr)
#define SRT_ATTR_REQUIRES2(expr1, expr2) _Requires_lock_held_(expr1) _Requires_lock_held_(expr2)
#define SRT_ATTR_REQUIRES_SHARED(...)
#define SRT_ATTR_ACQUIRE(expr) _Acquires_nonreentrant_lock_(expr)
#define SRT_ATTR_ACQUIRE_SHARED(...)
Expand Down Expand Up @@ -143,6 +144,9 @@ used by SRT library internally.
#define SRT_ATTR_REQUIRES(...) \
THREAD_ANNOTATION_ATTRIBUTE__(requires_capability(__VA_ARGS__))

#define SRT_ATTR_REQUIRES2(...) \
THREAD_ANNOTATION_ATTRIBUTE__(requires_capability(__VA_ARGS__))

#define SRT_ATTR_REQUIRES_SHARED(...) \
THREAD_ANNOTATION_ATTRIBUTE__(requires_shared_capability(__VA_ARGS__))

Expand Down

0 comments on commit 8d1643e

Please sign in to comment.