aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenny Levinsen <kl@kl.wtf>2020-08-01 23:10:24 +0200
committerKenny Levinsen <kl@kl.wtf>2020-08-01 23:13:54 +0200
commitd26466bf3bbd15d609e471202edb09dbc555fbe6 (patch)
tree16ef88d8276e3961c72f00b46fa844c332f3237f
parent2be0826959c68aa0dd756ee4437db1883887d8ce (diff)
Remove ALWAYS_INLINE
Didn't do what I wanted it to anyway.
-rw-r--r--common/connection.c9
-rw-r--r--include/compiler.h8
2 files changed, 5 insertions, 12 deletions
diff --git a/common/connection.c b/common/connection.c
index 0c2a0b6..a6739c0 100644
--- a/common/connection.c
+++ b/common/connection.c
@@ -6,22 +6,21 @@
#include <sys/socket.h>
#include <unistd.h>
-#include "compiler.h"
#include "connection.h"
-ALWAYS_INLINE static uint32_t connection_buffer_mask(const uint32_t idx) {
+static inline uint32_t connection_buffer_mask(const uint32_t idx) {
return idx & (CONNECTION_BUFFER_SIZE - 1);
}
-ALWAYS_INLINE static uint32_t connection_buffer_size(const struct connection_buffer *b) {
+static inline uint32_t connection_buffer_size(const struct connection_buffer *b) {
return b->head - b->tail;
}
-ALWAYS_INLINE static void connection_buffer_consume(struct connection_buffer *b, const size_t size) {
+static inline void connection_buffer_consume(struct connection_buffer *b, const size_t size) {
b->tail += size;
}
-ALWAYS_INLINE static void connection_buffer_restore(struct connection_buffer *b, const size_t size) {
+static inline void connection_buffer_restore(struct connection_buffer *b, const size_t size) {
b->tail -= size;
}
diff --git a/include/compiler.h b/include/compiler.h
index 11f3495..6a2b169 100644
--- a/include/compiler.h
+++ b/include/compiler.h
@@ -3,16 +3,10 @@
#ifdef __GNUC__
#define ATTRIB_PRINTF(start, end) __attribute__((format(printf, start, end)))
+#define LIBSEAT_EXPORT __attribute__((visibility("default")))
#else
#define ATTRIB_PRINTF(start, end)
-#endif
-
-#if defined(__GNUC__) && __GNUC__ >= 4
-#define LIBSEAT_EXPORT __attribute__((visibility("default")))
-#define ALWAYS_INLINE __attribute__((always_inline)) inline
-#else
#define LIBSEAT_EXPORT
-#define ALWAYS_INLINE inline
#endif
#define STRLEN(s) ((sizeof(s) / sizeof(s[0])) - 1)