flecs-hub/flecs-cs

Function-like macros

lithiumtoast opened this issue · 1 comments

Function like macros like the following should be supported through C2CS bottlenoselabs/c2cs#35

#define ECS_COMPONENT_DEFINE(world, id) \
    {\
        ecs_component_desc_t desc = {0}; \
        desc.entity.entity = ecs_id(id); \
        desc.entity.name = #id; \
        desc.entity.symbol = #id; \
        desc.size = sizeof(id); \
        desc.alignment = ECS_ALIGNOF(id); \
        ecs_id(id) = ecs_component_init(world, &desc);\
        ecs_assert(ecs_id(id) != 0, ECS_INVALID_PARAMETER, NULL);\
    }

How to handle the generic type parameter id needs research/tinkering.

Doing it my hand manually