Skip to content

src: namespace symbols clashing with lib - #14785

Closed
vszakats wants to merge 1 commit into
curl:masterfrom
vszakats:src-lib-enum-clash
Closed

vszakats wants to merge 1 commit into
curl:masterfrom
vszakats:src-lib-enum-clash

Conversation

@vszakats

@vszakats vszakats commented Sep 4, 2024 •

Copy link
Copy Markdown
Member

lib/http.h and src/tool_sdecls.h both declared HTTPREQ_*
enums.

Rename src ones to have distinct names.

They are not included in the same code for now, but this may
change when bundling unit/libtests into single programs. But I
figure it'd be nice to make these unique regardless.


Question: Would it be better to merge them and move them to
curl_setup.h or someplace shared between lib and src?

curl/lib/http.h

Lines 36 to 43 in 6a9b710

typedef enum {
HTTPREQ_GET,
HTTPREQ_POST,
HTTPREQ_POST_FORM, /* we make a difference internally */
HTTPREQ_POST_MIME, /* we make a difference internally */
HTTPREQ_PUT,
HTTPREQ_HEAD
} Curl_HttpReq;

curl/src/tool_sdecls.h

Lines 116 to 123 in 6a9b710

typedef enum {
HTTPREQ_UNSPEC, /* first in list */
HTTPREQ_GET,
HTTPREQ_HEAD,
HTTPREQ_MIMEPOST,
HTTPREQ_SIMPLEPOST,
HTTPREQ_PUT
} HttpReq;

lib/http.h and src/tool_sdecls.h both declared `HTTPREQ_*` enums.
These were used in the same source till now. They do now when
building bundling up unit tests into a single source file.
@vszakats vszakats closed this in 32eee8f Sep 4, 2024
@vszakats
vszakats deleted the src-lib-enum-clash branch September 4, 2024 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants