mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-10 00:41:26 +12:00
Compilation fix
This commit is contained in:
parent
f3b61f58ef
commit
2eeab1feb0
3 changed files with 23 additions and 15 deletions
|
@ -6,6 +6,14 @@
|
|||
#define thread_local __thread
|
||||
#endif
|
||||
|
||||
template<size_t size>
|
||||
void strcpy_trunc(char (&dst)[size], const std::string& src)
|
||||
{
|
||||
const size_t count = (src.size() >= size) ? size - 1 /* truncation */ : src.size();
|
||||
memcpy(dst, src.c_str(), count);
|
||||
dst[count] = 0;
|
||||
}
|
||||
|
||||
#if defined(__GNUG__)
|
||||
#include <cmath>
|
||||
#include <stdlib.h>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue