-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
777c8cd
commit 45eca3e
Showing
7 changed files
with
42 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#pragma once | ||
#include "srt.h" | ||
|
||
#if SRT_VERSION_VALUE >= SRT_MAKE_VERSION(1, 5, 0) | ||
#include "threadname.h" // srt::ThreadName | ||
#define XTR_THREADNAME(name) srt::ThreadName tn(name); | ||
#else | ||
#define XTR_THREADNAME(name) | ||
#endif | ||
|
||
namespace xtransmit | ||
{ | ||
namespace details | ||
{ | ||
template <typename T, typename... Args> | ||
std::unique_ptr<T> make_unique(Args&&... args) | ||
{ | ||
#if defined(_MSC_VER) || __cplusplus >= 201402L // C++14 and beyond | ||
return std::make_unique<T>(std::forward<Args>(args)...); | ||
#else | ||
static_assert(!std::is_array<T>::value, "arrays are not supported"); | ||
return std::unique_ptr<T>(new T(std::forward<Args>(args)...)); | ||
#endif | ||
} | ||
} // namespace details | ||
} // namespace xtransmit |