fix: rename vendored HTTPParserC enums to avoid macOS http.h conflicts#3073
Open
brucearctor wants to merge 2 commits into
Open
fix: rename vendored HTTPParserC enums to avoid macOS http.h conflicts#3073brucearctor wants to merge 2 commits into
brucearctor wants to merge 2 commits into
Conversation
The vendored http_parser.h defines enum types (http_method, http_status, http_errno) that conflict with macOS system header <http.h>, causing compilation failures on macOS targets. This renames the enum types to http_parser_method, http_parser_status, and http_parser_errno to avoid namespace collisions. The enum values were already prefixed with PARSER_HTTP_* in a previous fix, but the type names themselves were not. Also updates the Swift typealias and usages in HTTPParser+Raw.swift to reference the renamed types. Fixes leancodepl#1976
Contributor
There was a problem hiding this comment.
Code Review
This pull request renames the http_method, http_status, and http_errno enums to http_parser_method, http_parser_status, and http_parser_errno respectively across the C and Swift source files to improve naming consistency. A review comment identifies a remaining reference to the old enum name in a code comment within http_parser.h that should be updated for consistency.
Author
|
looks like failures are due to permissions? |
Address Gemini code review feedback — the comment on line 274 still referenced the old 'http_errno' enum name.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The vendored
http_parser.h(insidedarwin/Classes/Telegraph/HTTPParserC/) defines enum types (http_method,http_status,http_errno) that conflict with macOS system header<http.h>, causing compilation failures on macOS targets.A previous fix already prefixed the enum values (
HTTP_GET→PARSER_HTTP_GET), but the enum type names and function signatures were not updated.Solution
Rename the enum types to avoid namespace collisions:
enum http_method→enum http_parser_methodenum http_status→enum http_parser_statusenum http_errno→enum http_parser_errnoAlso updates the Swift typealias and usage in
HTTPParser+Raw.swiftto reference the renamed types.This matches the approach from the now-closed HTTPParserC PR #4 (upstream has since moved to
llhttp).Files Changed (3 files, 15 line swaps)
http_parser.h— renamed enum type declarations and function signatureshttp_parser.c— renamed enum type references in function implementationsHTTPParser+Raw.swift— updated typealias and constructor callFixes #1976