digitalocean / prometheus-client-c

A Prometheus Client in C
Other
160 stars 79 forks source link

Fix #64: failed build against newer libmicrohttpd versions #65

Open hadret opened 3 years ago

hadret commented 3 years ago

This MR fixes broken builds against newer libmicrohttpd versions while remaining compatible with the older ones. The change was introduced back in April last year by the upstream:

Wed 08 Apr 2020 10:53:01 PM CEST Introduce enum MHD_Result for #MHD_YES/#MHD_NO to avoid using 'int' so much. Note that this change WILL cause compiler warnings until (most) MHD callbacks in application code change their return type from 'int' to 'enum MHD_Result'. That said, avoiding possible confusions of different enums is going to make the code more robust in the future. For conditional compilation, test for "MHD_VERSION >= 0x00097002". -CG

And here's the relevant commit: https://git.gnunet.org/libmicrohttpd.git/commit/?id=6347f514aa2388e774d5bf356df8046864e5f73c

Many thanks to @janv37 for hunting this one down 🙌🏻

wferi commented 1 year ago

Ugh, I didn't notice this PR and submitted #79 myself, which also handles the same problem. Unfortunately is doesn't seem likely that either would be merged anytime soon. :(