> 3) Alan's pseudocode (not quite clear to me how this would look in C code, so > can't comment)
That comes from thinking about what client code looks like and how to keep it self-consistent.
I was thinking something along the lines of:
void load(void* data, char const* interface, unsigned version);
typedef struct { } foo_v1_extensions;
#define DEFINE_MIR_EXTENSION_FOO_VERSION1(var)\ struct { char const* const interface; unsigned const version; foo_v1_extensions extensions; } \ var = { "foo_v1_extensions_interface", 1, };
int main() { DEFINE_MIR_EXTENSION_FOO_VERSION1(x1); load(&x1.extensions, x1.interface, x1.version); return 0; }
« Back to merge proposal
> 3) Alan's pseudocode (not quite clear to me how this would look in C code, so
> can't comment)
That comes from thinking about what client code looks like and how to keep it self-consistent.
I was thinking something along the lines of:
void load(void* data, char const* interface, unsigned version);
typedef struct { } foo_v1_extensions;
#define DEFINE_ MIR_EXTENSION_ FOO_VERSION1( var)\ extensions_ interface" , 1, };
struct { char const* const interface; unsigned const version; foo_v1_extensions extensions; } \
var = { "foo_v1_
int main() MIR_EXTENSION_ FOO_VERSION1( x1); &x1.extensions, x1.interface, x1.version);
{
DEFINE_
load(
return 0;
}