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:
Max Kellermann
2021-02-08 14:59:40 +01:00
committed by Max Kellermann
parent 01af2778ab
commit 6cdb3ff21e
20 changed files with 61 additions and 80 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 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
@@ -90,13 +90,13 @@ public:
* Determine the socket type, i.e. SOCK_STREAM, SOCK_DGRAM or
* SOCK_SEQPACKET. Returns -1 on error.
*/
gcc_pure
[[gnu::pure]]
int GetType() const noexcept;
/**
* Is this a stream socket?
*/
gcc_pure
[[gnu::pure]]
bool IsStream() const noexcept;
using FileDescriptor::Get;
@@ -167,7 +167,7 @@ public:
* Receive peer credentials (SO_PEERCRED). On error, the pid
* is -1.
*/
gcc_pure
[[gnu::pure]]
struct ucred GetPeerCredentials() const noexcept;
#endif
@@ -226,10 +226,10 @@ public:
bool Connect(SocketAddress address) noexcept;
gcc_pure
[[gnu::pure]]
StaticSocketAddress GetLocalAddress() const noexcept;
gcc_pure
[[gnu::pure]]
StaticSocketAddress GetPeerAddress() const noexcept;
ssize_t Read(void *buffer, size_t length) noexcept;