Commit d2e137f
Fix CI: cpplint include order in http_utils.cpp + Windows ERROR macro clash
Two unrelated CI regressions on PR #374, both falling out of TASK-020:
1. Lint job (gcc-14, ubuntu): cpplint flagged
src/http_utils.cpp:30 with build/include_order, because the
matching public header ("httpserver/http_utils.hpp") came AFTER a
non-matching project header ("httpserver/constants.hpp"), and
<microhttpd.h> (a C system header in cpplint's view) followed both.
cpplint's expected order is: matching header, C system, C++ system,
other. Reorder so the matching header comes first and the project
headers ("constants.hpp" / "string_utilities.hpp") move to the
bottom of the include block.
2. Windows MSYS2 build: src/httpserver/http_utils.hpp failed with
error: expected identifier before numeric constant
at the line `ERROR = 0,` inside the digest_auth_result enum.
<wingdi.h> (pulled in via <windows.h> via <winsock2.h> via
<microhttpd.h> on MinGW) unconditionally `#define`s ERROR to 0,
and the preprocessor expands macros inside scoped-enum bodies just
like anywhere else. Pre-TASK-020 the enum was inside
`#ifdef HAVE_DAUTH`, so MSYS2 builds without digest auth never
compiled it; PRD-FLG-REQ-001 then made the enum unconditional and
exposed the latent collision. v2.0 is unreleased, so renaming is
safe: ERROR -> GENERIC_ERROR (matches MHD_DAUTH_ERROR's "general
error" docs). Static-assert pin in src/http_utils.cpp updated to
match.
Verified locally:
- python3 -m cpplint on both touched files: exit 0.
- `make check` on macOS: 32/32 PASS, all check-hygiene /
check-headers gates PASS.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 0d82a50 commit d2e137f
2 files changed
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| |||
57 | 56 | | |
58 | 57 | | |
59 | 58 | | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
634 | 634 | | |
635 | 635 | | |
636 | 636 | | |
637 | | - | |
638 | | - | |
| 637 | + | |
| 638 | + | |
639 | 639 | | |
640 | 640 | | |
641 | 641 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
156 | 159 | | |
157 | 160 | | |
158 | 161 | | |
| |||
0 commit comments