http-parser icon indicating copy to clipboard operation
http-parser copied to clipboard

rename XX macro in http_parser.h

Open freedaun opened this issue 5 years ago • 3 comments

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 avatar Jul 16 '19 17:07 freedaun

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

freedaun avatar Jul 16 '19 17:07 freedaun

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?

bnoordhuis avatar Jul 16 '19 17:07 bnoordhuis

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.

freedaun avatar Jul 16 '19 20:07 freedaun