nodejs / http-parser

http request/response parser for c
MIT License
6.32k stars 1.53k forks source link

rename XX macro in http_parser.h #487

Open freedaun opened 5 years ago

freedaun commented 5 years ago

Problem Description

I got a conflict with http_parser.h, which uses the same macro name:

define XX()

Code to reproduce this issue

define XX(x) something

Proposed solution

Never use non-descript unqualified macro-names in libs, as these identifier belong to the user and end up breaking their code. So either qualify the define and rename it HTTP_PARSER_XX(), or use the standard X-macro name convention ENTRY().

freedaun commented 5 years ago

I might add that I'm using this code downstream, in the Espressif ESP32. That's probably why this occurs.

bnoordhuis commented 5 years ago

This is about the http_status and http_method enums? I'm fine with changing those to something HTTP_PARSER_ qualified. Want to submit a PR?

freedaun commented 5 years ago

This is about the http_status and http_method enums?

yes.

Want to submit a PR?

No.. apparently a replace on XX to HTTP_PARSER_XX works.

thanks.