From 96c0e5a33d3676c5b54465e56a22dc8024c37c91 Mon Sep 17 00:00:00 2001 From: Ivan de Jesus Deras Date: Wed, 24 Apr 2024 13:41:57 -0600 Subject: [PATCH 1/4] Making the HTTP client lite library compile on MacOS --- 3rdpatry/http-client-lite/include/jdl/httpclientlite.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/3rdpatry/http-client-lite/include/jdl/httpclientlite.h b/3rdpatry/http-client-lite/include/jdl/httpclientlite.h index 4432308..9c79003 100644 --- a/3rdpatry/http-client-lite/include/jdl/httpclientlite.h +++ b/3rdpatry/http-client-lite/include/jdl/httpclientlite.h @@ -33,6 +33,8 @@ # define PLATFORM_LINUX #elif defined (_WIN32) || defined (_WIN64) # define PLATFORM_WINDOWS +#elif defined (__APPLE__) +# define PLATFORM_APPLE #else /* TODO: * - Added Apple OS */ @@ -59,7 +61,7 @@ # pragma comment(lib, "ws2_32.lib") -#elif defined (PLATFORM_LINUX) +#elif defined (PLATFORM_LINUX) || defined (PLATFORM_APPLE) # include # include # include From d57bf16d2c144c4492f4c5a9699642527bf95f53 Mon Sep 17 00:00:00 2001 From: Ivan de Jesus Deras Date: Wed, 24 Apr 2024 15:43:18 -0600 Subject: [PATCH 2/4] Remove some const modifier so the code compiles with clang --- core/include/prometheus/builder.h | 2 +- core/include/prometheus/family.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/include/prometheus/builder.h b/core/include/prometheus/builder.h index e5549c2..df58c55 100644 --- a/core/include/prometheus/builder.h +++ b/core/include/prometheus/builder.h @@ -14,7 +14,7 @@ namespace prometheus { std::string help_; public: - Builder& Labels(const std::map& labels) { + Builder& Labels(const std::map& labels) { labels_ = labels; return *this; } diff --git a/core/include/prometheus/family.h b/core/include/prometheus/family.h index 1c625c1..2d4d198 100644 --- a/core/include/prometheus/family.h +++ b/core/include/prometheus/family.h @@ -56,8 +56,8 @@ namespace prometheus { public: using Hash = std::size_t; - using Label = std::pair; - using Labels = std::map ; + using Label = std::pair; + using Labels = std::map ; using MetricPtr = std::unique_ptr; const Metric::Type type; From 77deeadbfc4b03b79fd607c73c28b59472e84dec Mon Sep 17 00:00:00 2001 From: Ivan de Jesus Deras Date: Wed, 22 May 2024 20:54:27 -0600 Subject: [PATCH 3/4] Include stdexcept in family.h so the code compile in GCC > 13 --- core/include/prometheus/family.h | 1 + 1 file changed, 1 insertion(+) diff --git a/core/include/prometheus/family.h b/core/include/prometheus/family.h index 2d4d198..74fcc8d 100644 --- a/core/include/prometheus/family.h +++ b/core/include/prometheus/family.h @@ -8,6 +8,7 @@ #include #include #include +#include #include "prometheus/collectable.h" #include "prometheus/metric.h" From 941ff089cb75a28deb465af31a63f79c72d5a243 Mon Sep 17 00:00:00 2001 From: Ivan de Jesus Deras Date: Sun, 2 Jun 2024 15:13:16 -0600 Subject: [PATCH 4/4] Changed the case of some windows include files to make the code cross compile on Linux under Mingw for a Windows target --- 3rdpatry/http-client-lite/include/jdl/httpclientlite.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/3rdpatry/http-client-lite/include/jdl/httpclientlite.h b/3rdpatry/http-client-lite/include/jdl/httpclientlite.h index 9c79003..36dbe18 100644 --- a/3rdpatry/http-client-lite/include/jdl/httpclientlite.h +++ b/3rdpatry/http-client-lite/include/jdl/httpclientlite.h @@ -53,8 +53,8 @@ #include #if defined (PLATFORM_WINDOWS) -# include -# include +# include +# include typedef SOCKET socktype_t; typedef int socklen_t;