From c5a454342f78eec4c58b1477d9190a084f40cfac Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 16 Jul 2016 16:05:48 +0200 Subject: attributes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/server.h | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'src/server.h') diff --git a/src/server.h b/src/server.h index 617b489..adf4c36 100644 --- a/src/server.h +++ b/src/server.h @@ -22,13 +22,23 @@ +#ifndef GCC_ONLY +# if defined(__GNUC__) && !defined(__clang__) +# define GCC_ONLY(...) __VA_ARGS__ +# else +# define GCC_ONLY(...) /* nothing */ +# endif +#endif + + + /** * List of all client's file descriptors * * Unused slots, with index less than `connections_used`, * should have the value -1 (negative) */ -extern int* connections; +extern int* restrict connections; /** * The number of elements allocated for `connections` @@ -48,12 +58,12 @@ extern size_t connections_used; /** * The clients' connections' inbound-message buffers */ -extern struct message* inbound; +extern struct message* restrict inbound; /** * The clients' connections' outbound-message buffers */ -extern struct ring* outbound; +extern struct ring* restrict outbound; @@ -72,7 +82,7 @@ void server_destroy(int disconnect); * this buffer needs * @return The number of marshalled bytes */ -size_t server_marshal(void* buf); +size_t server_marshal(void* restrict buf); /** * Unmarshal the state of the connections @@ -80,7 +90,7 @@ size_t server_marshal(void* buf); * @param buf Buffer for the marshalled data * @return The number of unmarshalled bytes, 0 on error */ -size_t server_unmarshal(const void* buf); +size_t server_unmarshal(const void* restrict buf); /** * The program's main loop -- cgit v1.2.3-70-g09d2