Skip to content
Snippets Groups Projects
Commit a31ddd50 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Interesting, these modern sea plus plusisms

This was necessary to get to build for MSVC2019 and GCC 8.3.0
parent a5e7b69d
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #2861 failed
......@@ -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());
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment