summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author couriersud <couriersud@gmx.org>2020-02-04 22:11:05 +0100
committer couriersud <couriersud@gmx.org>2020-02-04 23:24:46 +0100
commite204d878f8dd2a222821a81f6773e69529ce83e8 (patch)
tree4690451032dea316f8c8aa7dbc2e4123efb8ae22
parentcb8d763a722468889e7558137dea48956c71c28f (diff)
netlist: Fix VC compile. (nw)
-rwxr-xr-x[-rw-r--r--]src/lib/netlist/plib/palloc.h4
-rw-r--r--src/lib/netlist/plib/putil.h40
2 files changed, 27 insertions, 17 deletions
diff --git a/src/lib/netlist/plib/palloc.h b/src/lib/netlist/plib/palloc.h
index 035fbdb749d..c7a9f19c1c4 100644..100755
--- a/src/lib/netlist/plib/palloc.h
+++ b/src/lib/netlist/plib/palloc.h
@@ -18,6 +18,7 @@
#include <type_traits>
#include <utility>
#include <vector>
+#include <algorithm>
#if defined(_WIN32) || defined(_WIN64) || defined(_MSC_VER)
#include <malloc.h>
@@ -283,7 +284,8 @@ namespace plib {
static inline void *allocate( size_t alignment, size_t size )
{
m_stat_cur_alloc() += size;
- m_stat_max_alloc() = std::max(m_stat_max_alloc(), m_stat_cur_alloc());
+ if (m_stat_max_alloc() < m_stat_cur_alloc())
+ m_stat_max_alloc() = m_stat_cur_alloc();
#if (PUSE_ALIGNED_ALLOCATION)
#if defined(_WIN32) || defined(_WIN64) || defined(_MSC_VER)
diff --git a/src/lib/netlist/plib/putil.h b/src/lib/netlist/plib/putil.h
index b5fe06efb61..01dd66e5f91 100644
--- a/src/lib/netlist/plib/putil.h
+++ b/src/lib/netlist/plib/putil.h
@@ -44,22 +44,30 @@
#define PCONCAT_(a, b) a ## b
-#define PSTRINGIFY_1(x) #x
-#define PSTRINGIFY_2(x, x2) #x, #x2
-#define PSTRINGIFY_3(x, ...) #x, PSTRINGIFY_2(__VA_ARGS__)
-#define PSTRINGIFY_4(x, ...) #x, PSTRINGIFY_3(__VA_ARGS__)
-#define PSTRINGIFY_5(x, ...) #x, PSTRINGIFY_4(__VA_ARGS__)
-#define PSTRINGIFY_6(x, ...) #x, PSTRINGIFY_5(__VA_ARGS__)
-#define PSTRINGIFY_7(x, ...) #x, PSTRINGIFY_6(__VA_ARGS__)
-#define PSTRINGIFY_8(x, ...) #x, PSTRINGIFY_7(__VA_ARGS__)
-#define PSTRINGIFY_9(x, ...) #x, PSTRINGIFY_8(__VA_ARGS__)
-#define PSTRINGIFY_10(x, ...) #x, PSTRINGIFY_9(__VA_ARGS__)
-#define PSTRINGIFY_11(x, ...) #x, PSTRINGIFY_10(__VA_ARGS__)
-#define PSTRINGIFY_12(x, ...) #x, PSTRINGIFY_11(__VA_ARGS__)
-#define PSTRINGIFY_13(x, ...) #x, PSTRINGIFY_12(__VA_ARGS__)
-#define PSTRINGIFY_14(x, ...) #x, PSTRINGIFY_13(__VA_ARGS__)
-#define PSTRINGIFY_15(x, ...) #x, PSTRINGIFY_14(__VA_ARGS__)
-#define PSTRINGIFY_16(x, ...) #x, PSTRINGIFY_15(__VA_ARGS__)
+#define PSTRINGIFY_1(x) #x
+#define PSTRINGIFY_2(x, x2) #x, #x2
+#define PSTRINGIFY_3(x, x2, x3) #x, #x2, #x3
+#define PSTRINGIFY_4(x, x2, x3, x4) #x, #x2, #x3, #x4
+#define PSTRINGIFY_5(x, x2, x3, x4, x5) #x, #x2, #x3, #x4, #x5
+#define PSTRINGIFY_6(x, x2, x3, x4, x5, x6) #x, #x2, #x3, #x4, #x5, #x6
+#define PSTRINGIFY_7(x, x2, x3, x4, x5, x6, x7) #x, #x2, #x3, #x4, #x5, #x6, #x7
+#define PSTRINGIFY_8(x, x2, x3, x4, x5, x6, x7, x8) #x, #x2, #x3, #x4, #x5, #x6, #x7, #x8
+#define PSTRINGIFY_9(x, x2, x3, x4, x5, x6, x7, x8, x9) \
+ #x, #x2, #x3, #x4, #x5, #x6, #x7, #x8, #x9
+#define PSTRINGIFY_10(x, x2, x3, x4, x5, x6, x7, x8, x9, xa) \
+ #x, #x2, #x3, #x4, #x5, #x6, #x7, #x8, #x9, #xa
+#define PSTRINGIFY_11(x, x2, x3, x4, x5, x6, x7, x8, x9, xa, xb) \
+ #x, #x2, #x3, #x4, #x5, #x6, #x7, #x8, #x9, #xa, #xb
+#define PSTRINGIFY_12(x, x2, x3, x4, x5, x6, x7, x8, x9, xa, xb, xc) \
+ #x, #x2, #x3, #x4, #x5, #x6, #x7, #x8, #x9, #xa, #xb, #xc
+#define PSTRINGIFY_13(x, x2, x3, x4, x5, x6, x7, x8, x9, xa, xb, xc, xd) \
+ #x, #x2, #x3, #x4, #x5, #x6, #x7, #x8, #x9, #xa, #xb, #xc, #xd
+#define PSTRINGIFY_14(x, x2, x3, x4, x5, x6, x7, x8, x9, xa, xb, xc, xd, xe) \
+ #x, #x2, #x3, #x4, #x5, #x6, #x7, #x8, #x9, #xa, #xb, #xc, #xd, #xe
+#define PSTRINGIFY_15(x, x2, x3, x4, x5, x6, x7, x8, x9, xa, xb, xc, xd, xe, xf) \
+ #x, #x2, #x3, #x4, #x5, #x6, #x7, #x8, #x9, #xa, #xb, #xc, #xd, #xe, #xf
+#define PSTRINGIFY_16(x, x2, x3, x4, x5, x6, x7, x8, x9, xa, xb, xc, xd, xe, xf, x10) \
+ #x, #x2, #x3, #x4, #x5, #x6, #x7, #x8, #x9, #xa, #xb, #xc, #xd, #xe, #xf, #x10
/// \brief Individually stringify up to 16 arguments
///