Skip to content

Commit d6c586e

Browse files
committed
Modernize macro-expanded dependencies
1 parent f450b3e commit d6c586e

315 files changed

Lines changed: 5959 additions & 4151 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ endif()
5555

5656
if(BTECH_ENABLE_IWYU)
5757
find_program(IWYU_EXECUTABLE NAMES include-what-you-use-20 include-what-you-use REQUIRED)
58-
set(BTECH_IWYU_COMMAND "${IWYU_EXECUTABLE};-Xiwyu;--no_comments")
58+
set(BTECH_IWYU_COMMAND "${IWYU_EXECUTABLE}")
5959
endif()
6060

6161
find_package(SQLite3 REQUIRED)
@@ -206,6 +206,9 @@ set(BTECH_SOURCES
206206
${BTECH_SOURCE_DIR}/src/btech/autopilot_core.c
207207
${BTECH_SOURCE_DIR}/src/btech/autopilot_radio.c
208208
${BTECH_SOURCE_DIR}/src/btech/bsuit.c
209+
${BTECH_SOURCE_DIR}/src/btech/btech_channel.c
210+
${BTECH_SOURCE_DIR}/src/btech/btech_event.c
211+
${BTECH_SOURCE_DIR}/src/btech/btech_event_core.c
209212
${BTECH_SOURCE_DIR}/src/btech/btech.c
210213
${BTECH_SOURCE_DIR}/src/btech/btechstats.c
211214
${BTECH_SOURCE_DIR}/src/btech/crit.c
@@ -222,6 +225,7 @@ set(BTECH_SOURCES
222225
${BTECH_SOURCE_DIR}/src/btech/map.los.c
223226
${BTECH_SOURCE_DIR}/src/btech/map.c
224227
${BTECH_SOURCE_DIR}/src/btech/map.obj.c
228+
${BTECH_SOURCE_DIR}/src/btech/map.terrain.c
225229
${BTECH_SOURCE_DIR}/src/btech/mech.advanced.c
226230
${BTECH_SOURCE_DIR}/src/btech/mech.ammodump.c
227231
${BTECH_SOURCE_DIR}/src/btech/mech.bth.c
@@ -242,13 +246,15 @@ set(BTECH_SOURCES
242246
${BTECH_SOURCE_DIR}/src/btech/mech.hitloc.c
243247
${BTECH_SOURCE_DIR}/src/btech/mech.ice.c
244248
${BTECH_SOURCE_DIR}/src/btech/mech.lite.c
249+
${BTECH_SOURCE_DIR}/src/btech/mech.lifecycle.c
245250
${BTECH_SOURCE_DIR}/src/btech/mech.los.c
246251
${BTECH_SOURCE_DIR}/src/btech/mech.maps.c
247252
${BTECH_SOURCE_DIR}/src/btech/mech.mechref_ident.c
248253
${BTECH_SOURCE_DIR}/src/btech/mech.move.c
249254
${BTECH_SOURCE_DIR}/src/btech/mech.notify.c
250255
${BTECH_SOURCE_DIR}/src/btech/mech.ood.c
251256
${BTECH_SOURCE_DIR}/src/btech/mech.partnames.c
257+
${BTECH_SOURCE_DIR}/src/btech/mech.parts.c
252258
${BTECH_SOURCE_DIR}/src/btech/mech.physical.c
253259
${BTECH_SOURCE_DIR}/src/btech/mech.pickup.c
254260
${BTECH_SOURCE_DIR}/src/btech/mech.restrict.c
@@ -319,6 +325,70 @@ if(BTECH_ENABLE_IWYU)
319325
endif()
320326

321327
if(BUILD_TESTING)
328+
add_executable(btech_channel_test tests/btech_channel.c
329+
${BTECH_SOURCE_DIR}/src/btech/btech_channel.c)
330+
target_link_libraries(btech_channel_test PRIVATE btmux_options)
331+
target_include_directories(btech_channel_test PRIVATE
332+
"${CMAKE_BINARY_DIR}/${BTECH_SOURCE_DIR}"
333+
"${CMAKE_BINARY_DIR}"
334+
"${CMAKE_SOURCE_DIR}/${BTECH_SOURCE_DIR}/src/btech"
335+
"${CMAKE_SOURCE_DIR}/${BTECH_SOURCE_DIR}"
336+
"${CMAKE_SOURCE_DIR}/src")
337+
add_test(NAME btech_channel COMMAND btech_channel_test)
338+
339+
add_executable(btech_event_test tests/btech_event.c
340+
${BTECH_SOURCE_DIR}/src/btech/btech_event_core.c
341+
${MUX_SOURCE_DIR}/network/mux_event.c
342+
${MUX_SOURCE_DIR}/server/event_timer.c)
343+
target_link_libraries(btech_event_test PRIVATE btmux_options uv_a)
344+
target_include_directories(btech_event_test PRIVATE
345+
"${CMAKE_BINARY_DIR}/${BTECH_SOURCE_DIR}"
346+
"${CMAKE_BINARY_DIR}"
347+
"${CMAKE_SOURCE_DIR}/${BTECH_SOURCE_DIR}/src/btech"
348+
"${CMAKE_SOURCE_DIR}/${BTECH_SOURCE_DIR}"
349+
"${CMAKE_SOURCE_DIR}/src")
350+
add_test(NAME btech_event COMMAND btech_event_test)
351+
352+
add_executable(btech_terrain_test tests/btech_terrain.c
353+
${BTECH_SOURCE_DIR}/src/btech/map.terrain.c)
354+
target_link_libraries(btech_terrain_test PRIVATE btmux_options)
355+
target_include_directories(btech_terrain_test PRIVATE
356+
"${CMAKE_BINARY_DIR}/${BTECH_SOURCE_DIR}"
357+
"${CMAKE_BINARY_DIR}"
358+
"${CMAKE_SOURCE_DIR}/${BTECH_SOURCE_DIR}/src/include"
359+
"${CMAKE_SOURCE_DIR}/${BTECH_SOURCE_DIR}/src/btech"
360+
"${CMAKE_SOURCE_DIR}/${BTECH_SOURCE_DIR}"
361+
"${CMAKE_SOURCE_DIR}/src")
362+
add_test(NAME btech_terrain COMMAND btech_terrain_test)
363+
364+
add_executable(btech_lifecycle_test tests/btech_lifecycle.c
365+
${BTECH_SOURCE_DIR}/src/btech/mech.lifecycle.c)
366+
target_compile_options(btech_lifecycle_test PRIVATE -ffunction-sections)
367+
target_link_options(btech_lifecycle_test PRIVATE -Wl,--gc-sections)
368+
target_link_libraries(btech_lifecycle_test PRIVATE btmux_options)
369+
target_include_directories(btech_lifecycle_test PRIVATE
370+
"${CMAKE_BINARY_DIR}/${BTECH_SOURCE_DIR}"
371+
"${CMAKE_BINARY_DIR}"
372+
"${CMAKE_SOURCE_DIR}/${BTECH_SOURCE_DIR}/src/include"
373+
"${CMAKE_SOURCE_DIR}/${BTECH_SOURCE_DIR}/src/btech"
374+
"${CMAKE_SOURCE_DIR}/${BTECH_SOURCE_DIR}"
375+
"${CMAKE_SOURCE_DIR}/src")
376+
add_test(NAME btech_lifecycle COMMAND btech_lifecycle_test)
377+
378+
add_executable(btech_parts_test tests/btech_parts.c
379+
${BTECH_SOURCE_DIR}/src/btech/mech.parts.c)
380+
target_compile_options(btech_parts_test PRIVATE -ffunction-sections)
381+
target_link_options(btech_parts_test PRIVATE -Wl,--gc-sections)
382+
target_link_libraries(btech_parts_test PRIVATE btmux_options)
383+
target_include_directories(btech_parts_test PRIVATE
384+
"${CMAKE_BINARY_DIR}/${BTECH_SOURCE_DIR}"
385+
"${CMAKE_BINARY_DIR}"
386+
"${CMAKE_SOURCE_DIR}/${BTECH_SOURCE_DIR}/src/include"
387+
"${CMAKE_SOURCE_DIR}/${BTECH_SOURCE_DIR}/src/btech"
388+
"${CMAKE_SOURCE_DIR}/${BTECH_SOURCE_DIR}"
389+
"${CMAKE_SOURCE_DIR}/src")
390+
add_test(NAME btech_parts COMMAND btech_parts_test)
391+
322392
add_executable(event_timer_test tests/event_timer.c
323393
${MUX_SOURCE_DIR}/server/event_timer.c)
324394
target_link_libraries(event_timer_test PRIVATE btmux_options uv_a)

src/btech/btech_context.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,20 @@
22

33
#pragma once
44

5-
#include <stdbool.h>
6-
#include <stddef.h>
75
#include <time.h>
86

97
#include "btech/map_coding_registry.h"
108
#include "btech/missile_hit_registry.h"
119
#include "btech/random.h"
1210
#include "btech/weapon_settings.h"
11+
#include "mux/commands/command_context.h"
12+
#include "mux/commands/command_runtime.h"
13+
#include "mux/network/descriptor.h"
1314
#include "mux/server/platform.h"
1415
#include "mux/support/red_black_tree.h"
16+
#include "mux/world/world_context.h"
17+
18+
struct BtechContext; // IWYU pragma: keep
1519

1620
typedef struct AccessControlStore AccessControlStore;
1721
typedef struct CommandContext CommandContext;

src/btech/persistence/btech_persistence_sqlite.c

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
/* btech_persistence_sqlite.c -- BTech state in the MUX SQLite game database */
22

3-
#include "mux/server/platform.h"
4-
53
#include <errno.h>
64
#include <float.h>
75
#include <limits.h>
@@ -10,20 +8,32 @@
108
#include <stdio.h>
119
#include <stdlib.h>
1210
#include <string.h>
11+
#include <time.h>
1312

1413
#include "autopilot.h"
15-
#include "btech/btech_context.h"
16-
#include "glue.h"
14+
#include "btconfig.h"
15+
#include "btmux_build_config.h"
16+
#include "glue_types.h"
1717
#include "map.h"
18+
#include "map.terrain.h"
1819
#include "mech.events.h"
1920
#include "mech.h"
21+
#include "mech.parts.h"
2022
#include "mech.tech.h"
2123
#include "mechrep.h"
24+
#include "mux/network/mux_event.h"
25+
#include "mux/objects/db.h"
26+
#include "mux/objects/flags.h"
2227
#include "mux/persistence/gamedb.h"
2328
#include "mux/server/log.h"
29+
#include "mux/server/platform.h"
30+
#include "mux/server/server_config.h"
31+
#include "mux/support/alloc.h"
32+
#include "mux/support/doubly_linked_list.h"
2433
#include "mux/support/red_black_tree.h"
2534
#include "mux/support/utf8.h"
26-
#include "p.mech.events.h"
35+
#include "p.glue.h"
36+
#include "p.map.obj.h"
2737
#include "p.mech.utils.h"
2838
#include "p.template.h"
2939
#include "persistence/btech_persistence.h"

src/btech/src/btech/aero.bomb.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,34 @@
1414
#define GMOD 1 /* Acceleration / second, in Z hexes */
1515

1616
#include "aero.bomb.h"
17+
18+
#include <stdio.h>
19+
#include <stdlib.h>
20+
#include <strings.h>
21+
22+
#include "btconfig.h"
23+
#include "btech_context.h"
24+
#include "btech_event.h"
1725
#include "coolmenu.h"
26+
#include "macros.h"
27+
#include "map.h" // IWYU pragma: keep
28+
#include "map.terrain.h"
1829
#include "math.h"
1930
#include "mech.events.h"
2031
#include "mech.h"
32+
#include "mech.lifecycle.h"
33+
#include "mech.notify.h"
34+
#include "mux/network/mux_event.h"
2135
#include "mux/network/mux_event_alloc.h"
36+
#include "mux/support/alloc.h"
37+
#include "mux/support/formatting.h"
2238
#include "mycool.h"
39+
#include "mymath.h"
2340
#include "p.artillery.h"
2441
#include "p.econ_cmds.h"
42+
#include "p.glue.h"
43+
#include "p.glue.hcode.h"
44+
#include "p.mech.notify.h"
2545
#include "p.mech.utils.h"
2646

2747
static const BOMBINFO bombs[] = {

0 commit comments

Comments
 (0)