X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fstruct%2Fpool.h;h=f59fe2e4ba89a3fb720b9b5a63bef5b46a57c345;hb=e8b0472be10fba4ca6baa62d8d483db90e28c06e;hp=9bf4535b54822d2a49353f00f9f512a167c0d86b;hpb=da481df44a8fdd7c5501a03892c935504ff176aa;p=bertos.git diff --git a/bertos/struct/pool.h b/bertos/struct/pool.h index 9bf4535b..f59fe2e4 100644 --- a/bertos/struct/pool.h +++ b/bertos/struct/pool.h @@ -54,7 +54,7 @@ * // other members here... * } MyType; * - * DECLARE_POOL(mypool, MyType, POOL_SIZE); + * DEFINE_POOL(mypool, MyType, POOL_SIZE); * * static void elem_init(MyType *e) * { @@ -88,7 +88,7 @@ #define EXTERN_POOL(name) \ extern List name -#define DECLARE_POOL_WITH_STORAGE(name, type, num, storage) \ +#define DEFINE_POOL_WITH_STORAGE(name, type, num, storage) \ static type name##_items[num]; \ storage name; \ INLINE void name##_init(void (*init_func)(type*)) \ @@ -104,6 +104,9 @@ INLINE void name##_init(void (*init_func)(type*)) \ /**/ +/* For backwards compatibily */ +#define DECLARE_POOL_WITH_STORAGE DEFINE_POOL_WITH_STORAGE + /** * \brief Helper macro to declare a Pool data type. * @@ -114,16 +117,22 @@ * \param type Data type held by the pool. * \param num Number of elements in pool. */ -#define DECLARE_POOL(name, type, num) \ - DECLARE_POOL_WITH_STORAGE(name, type, num, List) +#define DEFINE_POOL(name, type, num) \ + DEFINE_POOL_WITH_STORAGE(name, type, num, List) + +/* For backwards compatibily */ +#define DECLARE_POOL DEFINE_POOL /** * \brief Static Pool declaration * - * \sa DECLARE_POOL + * \sa DEFINE_POOL */ -#define DECLARE_POOL_STATIC(name, type, num) \ - DECLARE_POOL_WITH_STORAGE(name, type, num, static List) +#define DEFINE_POOL_STATIC(name, type, num) \ + DEFINE_POOL_WITH_STORAGE(name, type, num, static List) + +/* For backwards compatibily */ +#define DECLARE_POOL_STATIC DEFINE_POOL_STATIC /** * Initialize the pool \a name, calling \a init_func on each element.