Skip to content

Commit 126f6a7

Browse files
committed
Fix #2148
1 parent a3f5569 commit 126f6a7

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

httplib.h

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,21 @@
1010

1111
#define CPPHTTPLIB_VERSION "0.22.0"
1212

13+
/*
14+
* Platform compatibility check
15+
*/
16+
17+
#if defined(_WIN32) && !defined(_WIN64)
18+
#error \
19+
"cpp-httplib doesn't support 32-bit Windows. Please use a 64-bit compiler."
20+
#elif defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ < 8
21+
#error \
22+
"cpp-httplib doesn't support 32-bit platforms. Please use a 64-bit compiler."
23+
#elif defined(__SIZEOF_SIZE_T__) && __SIZEOF_SIZE_T__ < 8
24+
#error \
25+
"cpp-httplib doesn't support platforms where size_t is less than 64 bits."
26+
#endif
27+
1328
/*
1429
* Configuration
1530
*/
@@ -7731,7 +7746,7 @@ inline void Server::apply_ranges(const Request &req, Response &res,
77317746

77327747
if (type != detail::EncodingType::None) {
77337748
if (pre_compression_logger_) { pre_compression_logger_(req, res); }
7734-
7749+
77357750
std::unique_ptr<detail::compressor> compressor;
77367751
std::string content_encoding;
77377752

0 commit comments

Comments
 (0)