aboutsummaryrefslogtreecommitdiffstats
path: root/src/server.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2016-07-16 16:05:48 +0200
committerMattias Andrée <maandree@kth.se>2016-07-16 16:05:48 +0200
commitc5a454342f78eec4c58b1477d9190a084f40cfac (patch)
tree3f98b7e6412182942bc36d44402790541d91fcea /src/server.h
parentThe stuff around supportinf SIGRTMIN+0 and SIGRTMIN+1 (diff)
downloadcoopgammad-c5a454342f78eec4c58b1477d9190a084f40cfac.tar.gz
coopgammad-c5a454342f78eec4c58b1477d9190a084f40cfac.tar.bz2
coopgammad-c5a454342f78eec4c58b1477d9190a084f40cfac.tar.xz
attributes
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--src/server.h20
1 files changed, 15 insertions, 5 deletions
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