Compilation fix for Musl systems v0.8.1
authorDavin McCall <davmac@davmac.org>
Wed, 1 Jan 2020 06:01:48 +0000 (16:01 +1000)
committerDavin McCall <davmac@davmac.org>
Wed, 1 Jan 2020 06:01:48 +0000 (16:01 +1000)
src/dasynq/dasynq-daryheap.h

index d824137966ffc59d561c745c8e5ad0668a924a13..2143ad2d937064924446a7d9f28ca0017c10071c 100644 (file)
@@ -6,6 +6,8 @@
 #include <utility>
 #include <limits>
 
+#include <cstddef>
+
 #include "dasynq-svec.h"
 
 
@@ -206,7 +208,7 @@ class dary_heap
         hnd.heap_index = -1;
 
         // largest object size is PTRDIFF_MAX, so we expect the largest vector is that / sizeof node:
-        constexpr hindex_t max_allowed = (std::numeric_limits<ptrdiff_t>::max() - 1) / sizeof(heap_node);
+        constexpr hindex_t max_allowed = (std::numeric_limits<std::ptrdiff_t>::max() - 1) / sizeof(heap_node);
 
         if (num_nodes == max_allowed) {
             throw std::bad_alloc();