Skip to content

Commit

Permalink
Fix build issue with custom build specifying FLECS_MONITOR and FLECS_…
Browse files Browse the repository at this point in the history
…REST
  • Loading branch information
SanderMertens committed Sep 29, 2023
1 parent e41500c commit 34c5a0d
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 8 deletions.
6 changes: 2 additions & 4 deletions flecs.c
Original file line number Diff line number Diff line change
Expand Up @@ -29937,7 +29937,7 @@ void FlecsMonitorImport(

ECS_COMPONENT_DEFINE(world, EcsWorldSummary);

#ifdef FLECS_META
#if defined(FLECS_META) && defined(FLECS_UNITS)
ecs_struct(world, {
.entity = ecs_id(EcsWorldSummary),
.members = {
Expand Down Expand Up @@ -43585,7 +43585,7 @@ void flecs_table_move_bitset_columns(
/* Grow table column. When a column needs to be reallocated this function takes
* care of correctly invoking ctor/move/dtor hooks. */
static
void* flecs_table_grow_column(
void flecs_table_grow_column(
ecs_world_t *world,
ecs_column_t *column,
int32_t to_add,
Expand Down Expand Up @@ -43650,8 +43650,6 @@ void* flecs_table_grow_column(
}

ecs_assert(column->data.size == dst_size, ECS_INTERNAL_ERROR, NULL);

return result;
}

/* Grow all data structures in a table */
Expand Down
2 changes: 1 addition & 1 deletion src/addons/monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ void FlecsMonitorImport(

ECS_COMPONENT_DEFINE(world, EcsWorldSummary);

#ifdef FLECS_META
#if defined(FLECS_META) && defined(FLECS_UNITS)
ecs_struct(world, {
.entity = ecs_id(EcsWorldSummary),
.members = {
Expand Down
4 changes: 1 addition & 3 deletions src/storage/table.c
Original file line number Diff line number Diff line change
Expand Up @@ -1317,7 +1317,7 @@ void flecs_table_move_bitset_columns(
/* Grow table column. When a column needs to be reallocated this function takes
* care of correctly invoking ctor/move/dtor hooks. */
static
void* flecs_table_grow_column(
void flecs_table_grow_column(
ecs_world_t *world,
ecs_column_t *column,
int32_t to_add,
Expand Down Expand Up @@ -1382,8 +1382,6 @@ void* flecs_table_grow_column(
}

ecs_assert(column->data.size == dst_size, ECS_INTERNAL_ERROR, NULL);

return result;
}

/* Grow all data structures in a table */
Expand Down
16 changes: 16 additions & 0 deletions test/custom_builds/c/monitor_rest/include/monitor_rest.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#ifndef MONITOR_REST_H
#define MONITOR_REST_H

/* This generated file contains includes for project dependencies */
#include "monitor_rest/bake_config.h"

#ifdef __cplusplus
extern "C" {
#endif

#ifdef __cplusplus
}
#endif

#endif

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
)
(.)
.|.
| |
_.--| |--._
.-'; ;`-'& ; `&.
\ & ; & &_/
|"""---...---"""|
\ | | | | | | | /
`---.|.|.|.---'
* This file is generated by bake.lang.c for your convenience. Headers of
* dependencies will automatically show up in this file. Include bake_config.h
* in your main project file. Do not edit! */

#ifndef MONITOR_REST_BAKE_CONFIG_H
#define MONITOR_REST_BAKE_CONFIG_H

/* Headers of public dependencies */
#include "../../deps/flecs.h"

#endif

14 changes: 14 additions & 0 deletions test/custom_builds/c/monitor_rest/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"id": "monitor_rest",
"type": "application",
"value": {
"public": false,
"use": [
"flecs"
],
"standalone": true
},
"lang.c": {
"defines": ["FLECS_CUSTOM_BUILD", "FLECS_MONITOR", "FLECS_REST", "FLECS_LOG"]
}
}
10 changes: 10 additions & 0 deletions test/custom_builds/c/monitor_rest/src/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include <monitor_rest.h>

int main(int argc, char *argv[]) {
ecs_world_t *world = ecs_init_w_args(argc, argv);

ECS_IMPORT(world, FlecsMonitor);
ECS_IMPORT(world, FlecsRest);

return ecs_fini(world);
}

0 comments on commit 34c5a0d

Please sign in to comment.