Author SHA1 Message Date
Patrick Pelissier 8a2549ef67 Add WIP prototype for separate generation of declarations and body
instead of just static inline functions.
Implemented for list only (and not for emplace generations)
2023-04-22 13:14:37 +02:00
3 changed files with 296 additions and 336 deletions

No files matched your search

+42
View File
@@ -449,6 +449,48 @@ M_BEGIN_PROTECTED_CODE
#define M_UNLIKELY_NOMEM(cond) M_UNLIKELY(cond)
/***************************************************************/
/****************** Function Generation Macro ******************/
/***************************************************************/
/*
* Define the expansion logic to define a public / private / type function
* for inline expansion
*/
#define M_EXPAND_FUNC_INLINE(proto, ...) \
static inline proto __VA_ARGS__
#define M_EXPAND_FUNC_INLINE_PRIVATE(...) \
__VA_ARGS__
#define M_EXPAND_FUNC_INLINE_TYPE(...) \
__VA_ARGS__
/*
* Define the expansion logic to define a public / private / type function
* for inline expansion
*/
#define M_EXPAND_FUNC_DECL(proto, ...) \
extern proto;
#define M_EXPAND_FUNC_DECL_PRIVATE(...)
#define M_EXPAND_FUNC_DECL_TYPE(...) \
__VA_ARGS__
/*
* Define the expansion logic to define a public / private / type function
* for inline expansion
*/
#define M_EXPAND_FUNC_BODY(proto, ...) \
proto __VA_ARGS__
#define M_EXPAND_FUNC_BODY_PRIVATE(...) \
__VA_ARGS__
#define M_EXPAND_FUNC_BODY_TYPE(...)
/***************************************************************/
/****************** Preprocessing Times Macro ******************/
/***************************************************************/
+2 -2
View File
@@ -26,7 +26,7 @@
#define MSTARLIB_I_LIST_H
#include "m-core.h"
#include "m-list.h" // For M_L1ST_ITBASE_DEF
#include "m-list.h" // For M_L1ST_DEF_ITBASE
/* Interface to add to a structure to enable intrusive doubly-linked support.
name: name of the intrusive list.
@@ -169,7 +169,7 @@ typedef struct m_il1st_head_s {
M_CHECK_COMPATIBLE_OPLIST(name, 1, type, oplist) \
M_IL1ST_DEF_CORE(name, type, oplist, list_t, it_t) \
/* Used of internal macro from m-list */ \
M_L1ST_ITBASE_DEF(name, type, oplist, list_t, it_t)
M_L1ST_DEF_ITBASE(M_EXPAND_FUNC_INLINE, name, type, oplist, list_t, it_t)
/* Define the type of an intrusive list */
#define M_IL1ST_DEF_TYPE(name, type, oplist, list_t, it_t) \
+252 -334
View File
File diff suppressed because it is too large. Load diff