@@ -4356,6 +4356,14 @@ void flecs_bootstrap(
43564356 /* Run bootstrap functions for other parts of the code */
43574357 flecs_bootstrap_hierarchy(world);
43584358
4359+ /* Register constant tag */
4360+ ecs_component(world, {
4361+ .entity = ecs_entity(world, { .id = EcsConstant,
4362+ .name = "constant", .symbol = "EcsConstant",
4363+ .add = ecs_ids(ecs_pair(EcsOnInstantiate, EcsDontInherit))
4364+ })
4365+ });
4366+
43594367 ecs_set_scope(world, 0);
43604368 ecs_set_name_prefix(world, NULL);
43614369
@@ -18500,10 +18508,11 @@ const ecs_entity_t ecs_id(EcsVector) = FLECS_HI_COMPONENT_ID + 107;
1850018508const ecs_entity_t ecs_id(EcsOpaque) = FLECS_HI_COMPONENT_ID + 108;
1850118509const ecs_entity_t ecs_id(EcsUnit) = FLECS_HI_COMPONENT_ID + 109;
1850218510const ecs_entity_t ecs_id(EcsUnitPrefix) = FLECS_HI_COMPONENT_ID + 110;
18503- const ecs_entity_t EcsConstant = FLECS_HI_COMPONENT_ID + 111;
1850418511const ecs_entity_t EcsQuantity = FLECS_HI_COMPONENT_ID + 112;
1850518512#endif
1850618513
18514+ const ecs_entity_t EcsConstant = FLECS_HI_COMPONENT_ID + 111;
18515+
1850718516/* Doc module components */
1850818517#ifdef FLECS_DOC
1850918518const ecs_entity_t ecs_id(EcsDocDescription) = FLECS_HI_COMPONENT_ID + 113;
@@ -22344,7 +22353,6 @@ ecs_entity_t ecs_cpp_enum_constant_register(
2234422353 ecs_entity_t value_type,
2234522354 size_t value_size)
2234622355{
22347- #ifdef FLECS_META
2234822356 ecs_suspend_readonly_state_t readonly_state;
2234922357 world = flecs_suspend_readonly(world, &readonly_state);
2235022358
@@ -22374,6 +22382,7 @@ ecs_entity_t ecs_cpp_enum_constant_register(
2237422382
2237522383 flecs_resume_readonly(world, &readonly_state);
2237622384
22385+ #ifdef FLECS_META
2237722386 if (ecs_should_log(0)) {
2237822387 ecs_value_t v = { .type = value_type, .ptr = value };
2237922388 char *str = NULL;
@@ -22384,19 +22393,9 @@ ecs_entity_t ecs_cpp_enum_constant_register(
2238422393 ecs_get_name(world, parent), name, str);
2238522394 ecs_os_free(str);
2238622395 }
22396+ #endif
2238722397
2238822398 return id;
22389- #else
22390- (void)world;
22391- (void)parent;
22392- (void)id;
22393- (void)name;
22394- (void)value;
22395- (void)value_type;
22396- (void)value_size;
22397- ecs_err("enum reflection not supported without FLECS_META addon");
22398- return 0;
22399- #endif
2240022399}
2240122400
2240222401#ifdef FLECS_META
@@ -51983,13 +51982,6 @@ void FlecsMetaImport(
5198351982 .type.alignment = ECS_ALIGNOF(EcsPrimitive)
5198451983 });
5198551984
51986- ecs_component(world, {
51987- .entity = ecs_entity(world, { .id = EcsConstant,
51988- .name = "constant", .symbol = "EcsConstant",
51989- .add = ecs_ids(ecs_pair(EcsOnInstantiate, EcsDontInherit))
51990- })
51991- });
51992-
5199351985 ecs_component(world, {
5199451986 .entity = ecs_entity(world, { .id = ecs_id(EcsEnum),
5199551987 .name = "enum", .symbol = "EcsEnum",
0 commit comments