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

Fix min() not being in scope when using GCC <C++, shrug>

parent 4b5a75c3
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#ifndef PCBDEFS_HPP_ #ifndef PCBDEFS_HPP_
#define PCBDEFS_HPP_ #define PCBDEFS_HPP_
#include <algorithm> // std::min
#include "endian.hpp" #include "endian.hpp"
namespace PCBoard { namespace PCBoard {
...@@ -47,6 +48,7 @@ class string { ...@@ -47,6 +48,7 @@ class string {
char value[size]{}; char value[size]{};
public: public:
void operator = (const char* s) { void operator = (const char* s) {
using std::min;
memset(value, ' ', size); memset(value, ' ', size);
memcpy(value, s, min(size, strlen(s))); memcpy(value, s, min(size, strlen(s)));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment