Commit 29dc6b4
fix(debug): Simplify unconditional DEBUG_ASSERTCRASH to DEBUG_CRASH (#2067)
Replace DEBUG_ASSERTCRASH(nullptr, ...) with DEBUG_CRASH(...) for
unconditional crash assertions in MinGW-w64 debug builds.
Changes:
- PlayerTemplate.cpp: DEBUG_ASSERTCRASH(nullptr) → DEBUG_CRASH
- ChallengeGenerals.cpp: DEBUG_ASSERTCRASH(nullptr) → DEBUG_CRASH
- LoadScreen.cpp: 2× DEBUG_ASSERTCRASH(nullptr) → DEBUG_CRASH
Total: 4 instances simplified across GeneralsMD codebase
Rationale:
DEBUG_ASSERTCRASH(nullptr, ...) was causing compilation errors with
MinGW-w64 due to implicit nullptr-to-bool conversion. These instances
represent "unconditional crash" assertions (always false condition).
The DEBUG_CRASH macro is the semantically correct choice for this use
case, making the intent explicit and avoiding type conversion issues.
Error resolved:
error: converting to 'bool' from 'std::nullptr_t' requires
direct-initialization [-fpermissive]
Historical note: These instances were introduced by commit f891c5f
("refactor: Modernize NULL to nullptr"). The original NULL was
semantically 0 (false), not a null pointer check.
Affects: GeneralsMD debug builds only1 parent f8fd4a5 commit 29dc6b4
3 files changed
Lines changed: 4 additions & 4 deletions
File tree
- GeneralsMD/Code/GameEngine/Source
- Common/RTS
- GameClient/GUI
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
297 | | - | |
| 297 | + | |
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1308 | 1308 | | |
1309 | 1309 | | |
1310 | 1310 | | |
1311 | | - | |
| 1311 | + | |
1312 | 1312 | | |
1313 | 1313 | | |
1314 | 1314 | | |
| |||
1579 | 1579 | | |
1580 | 1580 | | |
1581 | 1581 | | |
1582 | | - | |
| 1582 | + | |
1583 | 1583 | | |
1584 | 1584 | | |
1585 | 1585 | | |
| |||
0 commit comments