use [[gnu::pure]] instead of gcc_pure
This is semi-standard and doesn't require the util/Compiler.h header.
This commit is contained in:

committed by
Max Kellermann

parent
01af2778ab
commit
6cdb3ff21e
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2020 Max Kellermann <max.kellermann@gmail.com>
|
||||
* Copyright 2012-2021 Max Kellermann <max.kellermann@gmail.com>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -31,7 +31,6 @@
|
||||
#define SOCKET_ADDRESS_HXX
|
||||
|
||||
#include "Features.hxx"
|
||||
#include "util/Compiler.h"
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
@@ -118,14 +117,14 @@ public:
|
||||
* "size" attribute includes the null terminator. Returns
|
||||
* nullptr if not applicable.
|
||||
*/
|
||||
gcc_pure
|
||||
[[gnu::pure]]
|
||||
StringView GetLocalRaw() const noexcept;
|
||||
|
||||
/**
|
||||
* Returns the local socket path or nullptr if not applicable
|
||||
* (or if the path is corrupt).
|
||||
*/
|
||||
gcc_pure
|
||||
[[gnu::pure]]
|
||||
const char *GetLocalPath() const noexcept;
|
||||
#endif
|
||||
|
||||
@@ -133,25 +132,25 @@ public:
|
||||
/**
|
||||
* Is this the IPv6 wildcard address (in6addr_any)?
|
||||
*/
|
||||
gcc_pure
|
||||
[[gnu::pure]]
|
||||
bool IsV6Any() const noexcept;
|
||||
|
||||
/**
|
||||
* Is this an IPv4 address mapped inside struct sockaddr_in6?
|
||||
*/
|
||||
gcc_pure
|
||||
[[gnu::pure]]
|
||||
bool IsV4Mapped() const noexcept;
|
||||
|
||||
/**
|
||||
* Convert "::ffff:127.0.0.1" to "127.0.0.1".
|
||||
*/
|
||||
gcc_pure
|
||||
[[gnu::pure]]
|
||||
IPv4Address UnmapV4() const noexcept;
|
||||
|
||||
/**
|
||||
* Extract the port number. Returns 0 if not applicable.
|
||||
*/
|
||||
gcc_pure
|
||||
[[gnu::pure]]
|
||||
unsigned GetPort() const noexcept;
|
||||
#endif
|
||||
|
||||
@@ -162,10 +161,10 @@ public:
|
||||
* much for anything else. Returns nullptr if the address is
|
||||
* not supported.
|
||||
*/
|
||||
gcc_pure
|
||||
[[gnu::pure]]
|
||||
ConstBuffer<void> GetSteadyPart() const noexcept;
|
||||
|
||||
gcc_pure
|
||||
[[gnu::pure]]
|
||||
bool operator==(const SocketAddress other) const noexcept;
|
||||
|
||||
bool operator!=(const SocketAddress other) const noexcept {
|
||||
|
Reference in New Issue
Block a user