Move UC_INLINE to utils.h
This commit is contained in:
@@ -4,17 +4,6 @@
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include "tailq.h"
|
#include "tailq.h"
|
||||||
|
|
||||||
#ifndef UC_INLINE
|
|
||||||
#ifdef __GNUC__
|
|
||||||
# ifdef __clang__
|
|
||||||
# define UC_INLINE inline __attribute__((always_inline))
|
|
||||||
# else
|
|
||||||
# define UC_INLINE inline __attribute__((always_inline,flatten))
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
# define UC_INLINE inline
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** @file
|
/** @file
|
||||||
* mbuf - A managed message/memory buffer.
|
* mbuf - A managed message/memory buffer.
|
||||||
@@ -220,6 +209,4 @@ static UC_INLINE uint8_t *uc_mbuf_head(struct MBuf* mbuf)
|
|||||||
return mbuf->head;
|
return mbuf->head;
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef UC_INLINE
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+1
-12
@@ -2,18 +2,7 @@
|
|||||||
#define UC_PACK_H_
|
#define UC_PACK_H_
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include "utils.h"
|
||||||
#ifndef UC_INLINE
|
|
||||||
#ifdef __GNUC__
|
|
||||||
# ifdef __clang__
|
|
||||||
# define UC_INLINE inline __attribute__((always_inline))
|
|
||||||
# else
|
|
||||||
# define UC_INLINE inline __attribute__((always_inline,flatten))
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
# define UC_INLINE inline
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/** @file
|
/** @file
|
||||||
* Functions for serializing/de-serializing integers to and from
|
* Functions for serializing/de-serializing integers to and from
|
||||||
|
|||||||
+2
-13
@@ -1,17 +1,8 @@
|
|||||||
#ifndef UC_TAILQ_H_
|
#ifndef UC_TAILQ_H_
|
||||||
#define UC_TAILQ_H_
|
#define UC_TAILQ_H_
|
||||||
|
|
||||||
#ifndef UC_INLINE
|
#include "utils.h"
|
||||||
#ifdef __GNUC__
|
|
||||||
# ifdef __clang__
|
|
||||||
# define UC_INLINE inline __attribute__((always_inline))
|
|
||||||
# else
|
|
||||||
# define UC_INLINE inline __attribute__((always_inline,flatten))
|
|
||||||
# endif
|
|
||||||
#else
|
|
||||||
# define UC_INLINE inline
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
/**
|
/**
|
||||||
* Doubly Linked List.
|
* Doubly Linked List.
|
||||||
* It is used either as
|
* It is used either as
|
||||||
@@ -253,6 +244,4 @@ static UC_INLINE void uc_tailq_move_tail(struct TailQ *entry, struct TailQ *head
|
|||||||
(ptr) = (prv),\
|
(ptr) = (prv),\
|
||||||
(prv) = UC_TAILQ_CONTAINER(UC_TAILQ_NEXT(&(ptr)->member), typeof(*ptr), member))
|
(prv) = UC_TAILQ_CONTAINER(UC_TAILQ_NEXT(&(ptr)->member), typeof(*ptr), member))
|
||||||
|
|
||||||
#undef UC_INLINE
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -120,5 +120,16 @@ const typeof( ((const type *)0)->member ) *__mptr = (ptr); \
|
|||||||
*/
|
*/
|
||||||
#define UC_UNUSED(x) x __attribute__((unused))
|
#define UC_UNUSED(x) x __attribute__((unused))
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
# ifdef __clang__
|
||||||
|
# define UC_INLINE inline __attribute__((always_inline))
|
||||||
|
# else
|
||||||
|
# define UC_INLINE inline __attribute__((always_inline,flatten))
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
# define UC_INLINE inline
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user