Description
Compilation fails when building the engine with strict or modern toolchains due to missing explicit header inclusions.
Specifically, macro definitions like UINT8_MAX and POSIX system call primitives are missing their required standard headers, leading to "not declared in this scope" compiler errors when transitive dependencies are cleaned up by the preprocessor.
Environment
- OS: Linux (Arch Linux / CachyOS)
- Compiler: GCC (utilizing default Arch Linux packaging configurations)
- Component:
recoil-engine-rc core engine and test suite
Missing Headers Detail
1. Missing <cstdint> in rts/Game/ChatMessage.h
The header file references UINT8_MAX but does not explicitly include <cstdint>. In environments where other included headers no longer transitively expose standard integer limits, compilation fails.
- Affected File:
rts/Game/ChatMessage.h
- Required Fix: Include
<cstdint> before using fixed-width integer max macros.
2. Missing <unistd.h> in test/other/testMutex.cpp
The test suite utility utilizes low-level Linux/POSIX system calls or standard execution constants but lacks the fundamental standard symbolic constants header.
- Affected File:
test/other/testMutex.cpp
- Required Fix: Include
<unistd.h> at the top of the file to supply the necessary declarations for Linux syscall environments.
Description
Compilation fails when building the engine with strict or modern toolchains due to missing explicit header inclusions.
Specifically, macro definitions like
UINT8_MAXand POSIX system call primitives are missing their required standard headers, leading to "not declared in this scope" compiler errors when transitive dependencies are cleaned up by the preprocessor.Environment
recoil-engine-rccore engine and test suiteMissing Headers Detail
1. Missing
<cstdint>inrts/Game/ChatMessage.hThe header file references
UINT8_MAXbut does not explicitly include<cstdint>. In environments where other included headers no longer transitively expose standard integer limits, compilation fails.rts/Game/ChatMessage.h<cstdint>before using fixed-width integer max macros.2. Missing
<unistd.h>intest/other/testMutex.cppThe test suite utility utilizes low-level Linux/POSIX system calls or standard execution constants but lacks the fundamental standard symbolic constants header.
test/other/testMutex.cpp<unistd.h>at the top of the file to supply the necessary declarations for Linux syscall environments.