mirror of
https://github.com/mfontanini/libtins
synced 2026-01-23 02:35:57 +01:00
Renamed NOEXCEPT macro to TINS_NOEXCEPT.
This commit is contained in:
@@ -40,13 +40,13 @@
|
||||
#define TINS_END_PACK __pragma( pack(pop) )
|
||||
#define TINS_PACKED(DECLARATION) __pragma( pack(push, 1) ) DECLARATION __pragma( pack(pop) )
|
||||
#define TINS_DEPRECATED(func) __declspec(deprecated) func
|
||||
#define NOEXCEPT
|
||||
#define TINS_NOEXCEPT
|
||||
#else
|
||||
#define TINS_BEGIN_PACK
|
||||
#define TINS_END_PACK __attribute__((packed))
|
||||
#define TINS_PACKED(DECLARATION) DECLARATION __attribute__((packed))
|
||||
#define TINS_DEPRECATED(func) func __attribute__ ((deprecated))
|
||||
#define NOEXCEPT noexcept
|
||||
#define TINS_NOEXCEPT noexcept
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -215,14 +215,14 @@ public:
|
||||
/**
|
||||
* Move constructor.
|
||||
*/
|
||||
Packet(Packet &&rhs) NOEXCEPT : pdu_(rhs.pdu()), ts(rhs.timestamp()) {
|
||||
Packet(Packet &&rhs) TINS_NOEXCEPT : pdu_(rhs.pdu()), ts(rhs.timestamp()) {
|
||||
rhs.pdu_ = nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Move assignment operator.
|
||||
*/
|
||||
Packet& operator=(Packet &&rhs) NOEXCEPT {
|
||||
Packet& operator=(Packet &&rhs) TINS_NOEXCEPT {
|
||||
if(this != &rhs) {
|
||||
std::swap(pdu_, rhs.pdu_);
|
||||
ts = rhs.timestamp();
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace Tins {
|
||||
* \brief Move constructor.
|
||||
* \param rhs The sender to be moved.
|
||||
*/
|
||||
PacketSender(PacketSender &&rhs) NOEXCEPT {
|
||||
PacketSender(PacketSender &&rhs) TINS_NOEXCEPT {
|
||||
*this = std::move(rhs);
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ namespace Tins {
|
||||
* \brief Move assignment operator.
|
||||
* \param rhs The sender to be moved.
|
||||
*/
|
||||
PacketSender& operator=(PacketSender &&rhs) NOEXCEPT {
|
||||
PacketSender& operator=(PacketSender &&rhs) TINS_NOEXCEPT {
|
||||
_sockets = std::move(rhs._sockets);
|
||||
rhs._sockets = std::vector<int>(SOCKETS_END, INVALID_RAW_SOCKET);
|
||||
#ifndef WIN32
|
||||
|
||||
@@ -104,7 +104,7 @@ public:
|
||||
*
|
||||
* \param rhs The PacketWriter to be moved.
|
||||
*/
|
||||
PacketWriter(PacketWriter &&rhs) NOEXCEPT {
|
||||
PacketWriter(PacketWriter &&rhs) TINS_NOEXCEPT {
|
||||
*this = std::move(rhs);
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ public:
|
||||
*
|
||||
* \param rhs The PacketWriter to be moved.
|
||||
*/
|
||||
PacketWriter& operator=(PacketWriter &&rhs) NOEXCEPT {
|
||||
PacketWriter& operator=(PacketWriter &&rhs) TINS_NOEXCEPT {
|
||||
handle = 0;
|
||||
dumper = 0;
|
||||
std::swap(handle, rhs.handle);
|
||||
|
||||
@@ -149,7 +149,7 @@ namespace Tins {
|
||||
*
|
||||
* \param rhs The PDU to be moved.
|
||||
*/
|
||||
PDU(PDU &&rhs) NOEXCEPT
|
||||
PDU(PDU &&rhs) TINS_NOEXCEPT
|
||||
: _inner_pdu(0)
|
||||
{
|
||||
std::swap(_inner_pdu, rhs._inner_pdu);
|
||||
@@ -160,7 +160,7 @@ namespace Tins {
|
||||
*
|
||||
* \param rhs The PDU to be moved.
|
||||
*/
|
||||
PDU& operator=(PDU &&rhs) NOEXCEPT {
|
||||
PDU& operator=(PDU &&rhs) TINS_NOEXCEPT {
|
||||
std::swap(_inner_pdu, rhs._inner_pdu);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace Tins {
|
||||
* \brief Move constructor.
|
||||
* This constructor is available only in C++11.
|
||||
*/
|
||||
BaseSniffer(BaseSniffer &&rhs) NOEXCEPT
|
||||
BaseSniffer(BaseSniffer &&rhs) TINS_NOEXCEPT
|
||||
: handle(nullptr), mask()
|
||||
{
|
||||
*this = std::move(rhs);
|
||||
@@ -78,7 +78,7 @@ namespace Tins {
|
||||
* \brief Move assignment operator.
|
||||
* This operator is available only in C++11.
|
||||
*/
|
||||
BaseSniffer& operator=(BaseSniffer &&rhs) NOEXCEPT
|
||||
BaseSniffer& operator=(BaseSniffer &&rhs) TINS_NOEXCEPT
|
||||
{
|
||||
using std::swap;
|
||||
swap(handle, rhs.handle);
|
||||
|
||||
Reference in New Issue
Block a user