74b259ef196078ec3c3109993ce1c19dbd7a23d1
Simplified conditional compilation by wrapping the entire system.c file with a single #ifdef BUILD_TEST guard, removing all nested conditionals for simulation client code. **Rationale:** The entire system.c file contains simulation framework code (mock functions, Process structure, spawn_simulated_process, update_simulation, etc.) that is only used when BUILD_TEST is defined. Having nested #ifdef BUILD_TEST conditionals within this file made no sense. **Changes:** **system.c:** - Added #ifdef BUILD_TEST at the very beginning of the file (line 1) - Added #endif // BUILD_TEST at the very end of the file (line 1486) - Removed #ifdef BUILD_TEST around simulation_client.h include - Removed #ifdef BUILD_TEST around PROCESS_TYPE_CLIENT enum value - Removed #ifdef BUILD_TEST around SimulationClient union member - Removed #ifdef BUILD_TEST around is_client() function - Removed #ifdef BUILD_TEST around client detection in spawn_simulated_process() - Removed #ifdef BUILD_TEST around PROCESS_TYPE_CLIENT cases in: - spawn_simulated_process() init switch - free_process() cleanup switch - update_simulation() step switch **Result:** - Much cleaner code with single top-level BUILD_TEST guard - No nested conditionals cluttering the code - All three build targets still compile successfully: - tinydfs_server.out (excludes system.c entirely) - example_client.out (excludes system.c entirely) - tinydfs_test.out (includes all of system.c) - Simulation runs correctly with client support The file structure now correctly reflects that system.c is purely test infrastructure and not used in production builds.
Languages
C
98.4%
Shell
1%
Zig
0.4%
Batchfile
0.2%