Skip to content

Commit

Permalink
list.h: Allow separation of declarations and function definitions
Browse files Browse the repository at this point in the history
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from #22674)
  • Loading branch information
hlandau committed Dec 21, 2023
1 parent e8e95f2 commit 3f0be2c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions include/internal/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@
OSSL_LIST_DBG(struct ossl_list_st_ ## name *list) \
} ossl_list_ ## name

# define DEFINE_LIST_OF(name, type) \
# define DECLARE_LIST_OF(name, type) \
typedef struct ossl_list_st_ ## name OSSL_LIST(name); \
struct ossl_list_st_ ## name { \
type *alpha, *omega; \
size_t num_elems; \
}; \
} \

# define DEFINE_LIST_OF_IMPL(name, type) \
static ossl_unused ossl_inline void \
ossl_list_##name##_init(OSSL_LIST(name) *list) \
{ \
Expand Down Expand Up @@ -166,4 +168,8 @@
} \
struct ossl_list_st_ ## name

# define DEFINE_LIST_OF(name, type) \
DECLARE_LIST_OF(name, type); \
DEFINE_LIST_OF_IMPL(name, type)

#endif

0 comments on commit 3f0be2c

Please sign in to comment.