Commit a31ddd50 authored by Rob Swindell's avatar Rob Swindell 💬
Browse files

Interesting, these modern sea plus plusisms

This was necessary to get to build for MSVC2019 and GCC 8.3.0
parent a5e7b69d
Pipeline #2861 failed with stage
in 9 minutes and 36 seconds
......@@ -26,7 +26,7 @@
#include "xpendian.h"
namespace Pascal {
template <size_t size>
class String {
static_assert(size <= UCHAR_MAX, "PascalString size cannot be > 255");
......@@ -36,8 +36,9 @@ public:
return buf[0];
}
void operator = (const char* s) {
using std::min;
memset(buf, 0, size);
buf[0] = (uint8_t)std::min(size, strlen(s));
buf[0] = (uint8_t)min(size, strlen(s));
memcpy(buf + 1, s, len());
}
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment