Re:Httpserver.h: Single header library for writing non-block...
by jeremycw on Thursday December 12, 2019 @10:32PM
(#21778952)
This only causes a problem if you define HTTP_BODY in the same file that you define HTTPSERVER_IMPL when including httpserver.h
[ Parent
| on HN ]
Re:Httpserver.h: Single header library for writing non-block...
by hamburglar on Friday December 13, 2019 @01:32AM
(#21779569)
Well yes, it's a small isolation failure, but a failure nonetheless. It may seem like a contrived example, but "HTTP_BODY" would be a perfectly reasonable choice of variable or macro name for someone building a tiny embedded web server, and then you have a user (the user in this case being a developer using your library) having to debug your code because its internal assumptions collide with the outside world in a way that's completely avoidable if you just put it in a separate compilation unit.