diff options
Diffstat (limited to 'src/nvim/lib/queue_defs.h')
-rw-r--r-- | src/nvim/lib/queue_defs.h | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/src/nvim/lib/queue_defs.h b/src/nvim/lib/queue_defs.h index 1f113a057a..4f32f5fcb6 100644 --- a/src/nvim/lib/queue_defs.h +++ b/src/nvim/lib/queue_defs.h @@ -21,13 +21,15 @@ #include <stddef.h> -#include "nvim/func_attr.h" - typedef struct queue { struct queue *next; struct queue *prev; } QUEUE; +#ifdef INCLUDE_GENERATED_DECLARATIONS +# include "lib/queue_defs.h.inline.generated.h" +#endif + // Public macros. #define QUEUE_DATA(ptr, type, field) \ ((type *)((char *)(ptr) - offsetof(type, field))) @@ -44,29 +46,23 @@ typedef struct queue { } // ffi.cdef is unable to swallow `bool` in place of `int` here. -static inline int QUEUE_EMPTY(const QUEUE *q) - REAL_FATTR_ALWAYS_INLINE REAL_FATTR_PURE REAL_FATTR_WARN_UNUSED_RESULT; - static inline int QUEUE_EMPTY(const QUEUE *const q) + FUNC_ATTR_ALWAYS_INLINE FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT { return q == q->next; } #define QUEUE_HEAD(q) (q)->next -static inline void QUEUE_INIT(QUEUE *q) - REAL_FATTR_ALWAYS_INLINE; - static inline void QUEUE_INIT(QUEUE *const q) + FUNC_ATTR_ALWAYS_INLINE { q->next = q; q->prev = q; } -static inline void QUEUE_ADD(QUEUE *h, QUEUE *n) - REAL_FATTR_ALWAYS_INLINE; - static inline void QUEUE_ADD(QUEUE *const h, QUEUE *const n) + FUNC_ATTR_ALWAYS_INLINE { h->prev->next = n->next; n->next->prev = h->prev; @@ -74,10 +70,8 @@ static inline void QUEUE_ADD(QUEUE *const h, QUEUE *const n) h->prev->next = h; } -static inline void QUEUE_INSERT_HEAD(QUEUE *h, QUEUE *q) - REAL_FATTR_ALWAYS_INLINE; - static inline void QUEUE_INSERT_HEAD(QUEUE *const h, QUEUE *const q) + FUNC_ATTR_ALWAYS_INLINE { q->next = h->next; q->prev = h; @@ -85,10 +79,8 @@ static inline void QUEUE_INSERT_HEAD(QUEUE *const h, QUEUE *const q) h->next = q; } -static inline void QUEUE_INSERT_TAIL(QUEUE *h, QUEUE *q) - REAL_FATTR_ALWAYS_INLINE; - static inline void QUEUE_INSERT_TAIL(QUEUE *const h, QUEUE *const q) + FUNC_ATTR_ALWAYS_INLINE { q->next = h; q->prev = h->prev; @@ -96,10 +88,8 @@ static inline void QUEUE_INSERT_TAIL(QUEUE *const h, QUEUE *const q) h->prev = q; } -static inline void QUEUE_REMOVE(QUEUE *q) - REAL_FATTR_ALWAYS_INLINE; - static inline void QUEUE_REMOVE(QUEUE *const q) + FUNC_ATTR_ALWAYS_INLINE { q->prev->next = q->next; q->next->prev = q->prev; |