From 604607d3463fbe13eac252308f8a2497fb190167 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Fri, 11 Nov 2016 20:42:36 +0100 Subject: [PATCH] write_prometheus plugin: Use the "static" macro to specify PROMETHEUS_DEFAULT_STALENESS_DELTA. Fixes: write_prometheus.c:56:1: error: initializer element is not constant static cdtime_t staleness_delta = PROMETHEUS_DEFAULT_STALENESS_DELTA; ^ --- src/write_prometheus.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/write_prometheus.c b/src/write_prometheus.c index 43a60fc9..fe7a5b59 100644 --- a/src/write_prometheus.c +++ b/src/write_prometheus.c @@ -37,7 +37,7 @@ #include #ifndef PROMETHEUS_DEFAULT_STALENESS_DELTA -#define PROMETHEUS_DEFAULT_STALENESS_DELTA TIME_T_TO_CDTIME_T(300) +#define PROMETHEUS_DEFAULT_STALENESS_DELTA TIME_T_TO_CDTIME_T_STATIC(300) #endif #define VARINT_UINT32_BYTES 5 @@ -210,12 +210,11 @@ static int http_handler(void *cls, struct MHD_Connection *connection, else format_text(buffer); - struct MHD_Response *res = #if defined(MHD_VERSION) && MHD_VERSION >= 0x00090500 - MHD_create_response_from_buffer( + struct MHD_Response *res = MHD_create_response_from_buffer( simple.len, simple.data, MHD_RESPMEM_MUST_COPY); #else - MHD_create_response_from_data( + struct MHD_Response *res = MHD_create_response_from_data( simple.len, simple.data, /* must_free = */ 0, /* must_copy = */ 1); #endif MHD_add_response_header(res, MHD_HTTP_HEADER_CONTENT_TYPE, -- 2.11.0