FreePSXBoot icon indicating copy to clipboard operation
FreePSXBoot copied to clipboard

std::memcpy -> memcpy

Open socram8888 opened this issue 2 years ago • 3 comments

Current code is causing compilation errors in Debian bookworm. Replacing std::memcpy with just memcpy (as the rest of the memcpy calls are) fixed the issue.

builder.cc: In function ‘void createImage(ImageSettings, const uint8_t*, uint32_t)’:
builder.cc:693:14: error: ‘memcpy’ is not a member of ‘std’; did you mean ‘wmemcpy’?
  693 |         std::memcpy(out.data() + out.size() / 2, out.data(), out.size() / 2);
      |              ^~~~~~
      |              wmemcpy

socram8888 avatar Nov 24 '22 00:11 socram8888

Duplicate of https://github.com/brad-lin/FreePSXBoot/pull/97

alex-free avatar Nov 24 '22 00:11 alex-free

Actually I don't know what's better. I initially did the same thing for my pull request but then realized I could just add #include cstring to fix it and settled on that.

alex-free avatar Nov 24 '22 01:11 alex-free

Not sure. There's only one std::memcpy and plenty of regular memcpy in that file, so I guessed this one was a mistake.

socram8888 avatar Nov 24 '22 10:11 socram8888