From 464cc89b7708a7d63b390ff9a1ee3ba39e616eb5 Mon Sep 17 00:00:00 2001 From: yhirose Date: Wed, 12 Feb 2020 22:35:52 -0500 Subject: [PATCH] Fix #351 --- httplib.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/httplib.h b/httplib.h index 1d8910a..6a35ffb 100644 --- a/httplib.h +++ b/httplib.h @@ -41,7 +41,7 @@ #endif #ifndef CPPHTTPLIB_PAYLOAD_MAX_LENGTH -#define CPPHTTPLIB_PAYLOAD_MAX_LENGTH (std::numeric_limits::max)() +#define CPPHTTPLIB_PAYLOAD_MAX_LENGTH (std::numeric_limits::max()) #endif #ifndef CPPHTTPLIB_RECV_BUFSIZ @@ -49,12 +49,7 @@ #endif #ifndef CPPHTTPLIB_THREAD_POOL_COUNT -// if hardware_concurrency() outputs 0 we still wants to use threads for this. -// -1 because we have one thread already in the main function. -#define CPPHTTPLIB_THREAD_POOL_COUNT \ - (std::thread::hardware_concurrency() \ - ? std::thread::hardware_concurrency() - 1 \ - : 2) +#define CPPHTTPLIB_THREAD_POOL_COUNT (std::max(1u, std::thread::hardware_concurrency() - 1)) #endif /*