diff --git a/Makefile b/Makefile index 647cdec..0d539b4 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ distclean: clean cleandocs prom: -mkdir prom/build$(TESTDIR) && cd prom/build$(TESTDIR) && \ - TEST=$(TEST) cmake -v -G "Unix Makefiles" $(CMAKE_EXTRA_OPTS) .. + TEST=$(TEST) cmake -G "Unix Makefiles" $(CMAKE_EXTRA_OPTS) .. cd prom/build$(TESTDIR) && $(MAKE) $(MAKE_FLAGS) # Run "ctest --verbose --force-new-ctest-process" to get the details @@ -61,7 +61,7 @@ docs: cleandocs smoke: build promtest/prom2json.sh -mkdir promtest/build && cd promtest/build && \ - cmake -v -G "Unix Makefiles" $(CMAKE_EXTRA_OPTS) .. + cmake -G "Unix Makefiles" $(CMAKE_EXTRA_OPTS) .. cd promtest/build && $(MAKE) $(MAKE_FLAGS) @echo "Test takes ~ 1 min ..." PATH=$${PWD}/bin:$${PATH} \ diff --git a/promhttp/src/promhttp.c b/promhttp/src/promhttp.c index a7db841..cb68ac9 100644 --- a/promhttp/src/promhttp.c +++ b/promhttp/src/promhttp.c @@ -32,7 +32,11 @@ promhttp_set_active_collector_registry(pcr_t *registry) { PROM_WARN("No registry set to answer http requests", ""); } -int +#if MHD_VERSION >= 0x00097500 + enum MHD_Result +#else + int +#endif promhttp_handler(void *cls, struct MHD_Connection *connection, const char *url, const char *method, const char *version, const char *upload_data, size_t *upload_data_size, void **con_cls) @@ -42,7 +46,11 @@ promhttp_handler(void *cls, struct MHD_Connection *connection, const char *url, enum MHD_ResponseMemoryMode mode = MHD_RESPMEM_PERSISTENT; unsigned int status = MHD_HTTP_BAD_REQUEST; +#if MHD_VERSION >= 0x00097500 + enum MHD_Result ret; +#else int ret; +#endif if (strcmp(method, "GET") != 0) { body = "Invalid HTTP Method\n"; diff --git a/promtest/test/promtest.c b/promtest/test/promtest.c index 48be729..68481cf 100644 --- a/promtest/test/promtest.c +++ b/promtest/test/promtest.c @@ -24,6 +24,7 @@ #include "promtest_helpers.h" #include "unity.h" +struct MHD_Daemon *promtest_daemon; pthread_mutex_t smoke_mutex = PTHREAD_MUTEX_INITIALIZER; void diff --git a/promtest/test/promtest_helpers.h b/promtest/test/promtest_helpers.h index c2607f0..b1a0708 100644 --- a/promtest/test/promtest_helpers.h +++ b/promtest/test/promtest_helpers.h @@ -24,7 +24,7 @@ #define PORT 8000 #define ENDPOINT "http://0.0.0.0:8000/metrics" // keep in sync with PORT -struct MHD_Daemon *promtest_daemon; +extern struct MHD_Daemon *promtest_daemon; typedef struct promtest_popen_buf { char *buf;