]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
list.h: Allow separation of declarations and function definitions
authorHugo Landau <hlandau@openssl.org>
Thu, 9 Nov 2023 10:27:13 +0000 (10:27 +0000)
committerHugo Landau <hlandau@openssl.org>
Thu, 21 Dec 2023 08:11:59 +0000 (08:11 +0000)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22674)

include/internal/list.h

index fdd356c407d1c5966002767aac69d5a58d83fd72..de2a102cd448a2bb63f179d0e5ae541f2f5a2728 100644 (file)
         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)                          \
     {                                                                       \
     }                                                                       \
     struct ossl_list_st_ ## name
 
+# define DEFINE_LIST_OF(name, type)                                         \
+    DECLARE_LIST_OF(name, type);                                            \
+    DEFINE_LIST_OF_IMPL(name, type)
+
 #endif