blob: 4941148571f3e13985606fdf68d725dc568a01c2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
extern void *malloc(__SIZE_TYPE__);
typedef struct T T;
struct T {
void (*destroy)(void *);
};
void destroy(union { void *this; } __attribute__((transparent_union)));
static const typeof(destroy) *_destroy = (const typeof(destroy)*)destroy;
void destroy(void *this);
static T *create_empty(void)
{
T *this = malloc(sizeof(*this));
*this = (typeof(*this)){ _destroy };
return this;
}
void openssl_crl_load(void)
{
T *this = create_empty();
destroy(this);
}
|