aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/amqpcpp/fix-max_min_macros.patch
blob: 4d1e2ae205af370b5e6bec3e215b8259b6f4e5e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
diff --git a/include/amqpcpp/message.h b/include/amqpcpp/message.h
index 0a35838..96b43e1 100644
--- a/include/amqpcpp/message.h
+++ b/include/amqpcpp/message.h
@@ -80,7 +80,7 @@ protected:
         // safety-check: on 32-bit platforms size_t is obviously also a 32-bit dword
         // in which case casting the uint64_t to a size_t could result in truncation
         // here we check whether the given size fits inside a size_t
-        if (std::numeric_limits<size_t>::max() < size) throw std::runtime_error("message is too big for this system");
+        if ((std::numeric_limits<size_t>::max)() < size) throw std::runtime_error("message is too big for this system");
 
         // store the new size
         _bodySize = size;
@@ -98,7 +98,7 @@ protected:
         if (_mutableBody)
         {
             // prevent overflow
-            size = std::min(size, _bodySize - _filled);
+            size = (std::min)(size, _bodySize - _filled);
             
             // append more data
             memcpy(_mutableBody + _filled, buffer, (size_t)size);
@@ -121,7 +121,7 @@ protected:
             _body = _mutableBody;
             
             // store the initial data
-            _filled = std::min((size_t)size, (size_t)_bodySize);
+            _filled = (std::min)((size_t)size, (size_t)_bodySize);
             memcpy(_mutableBody, buffer, _filled);
         }