From: Hugo Landau Date: Thu, 9 Nov 2023 10:27:13 +0000 (+0000) Subject: list.h: Allow separation of declarations and function definitions X-Git-Tag: openssl-3.3.0-alpha1~449 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f0be2c206498b3fa3dd0a4dd94e31eb43d04c4a;p=thirdparty%2Fopenssl.git list.h: Allow separation of declarations and function definitions Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/22674) --- diff --git a/include/internal/list.h b/include/internal/list.h index fdd356c407d..de2a102cd44 100644 --- a/include/internal/list.h +++ b/include/internal/list.h @@ -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) \ { \ @@ -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