Commit 55ee429
authored
fix(basetype): Add min/max template functions to BaseType.h (TheSuperHackers#2183)
Add lowercase min/max template functions to BaseType.h alongside existing
uppercase MIN/MAX macros from BaseTypeCore.h.
Problem: BitFlags.h and other GameEngine code needed readable min() calls,
but VC6's <algorithm> lacks std::min/std::max. GameEngine code cannot rely
on always.h (WWVegas layer).
Solution: Add min/max templates to BaseType.h with header guard to prevent
conflicts when GameEngine code includes both BaseType.h and WWVegas headers
(which also define min/max in always.h).
Implementation:
- Use same header guard as always.h (_MIN_MAX_TEMPLATES_DEFINED_)
- Templates coexist with uppercase MIN/MAX macros
- Works with VC6, MSVC, and MinGW-w64
- Follows existing BaseType.h pattern (sqr, clamp, sign templates)1 parent 07b9d0e commit 55ee429
1 file changed
Lines changed: 24 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
61 | 83 | | |
62 | 84 | | |
63 | 85 | | |
| |||
179 | 201 | | |
180 | 202 | | |
181 | 203 | | |
182 | | - | |
183 | | - | |
| 204 | + | |
| 205 | + | |
184 | 206 | | |
185 | 207 | | |
186 | 208 | | |
| |||
0 commit comments