Fixed bug 4662 - SDL failed to build due to error LNK2019: unresolved external symbol _memset referenced in function _IMA_ADPCM_Decode with MSVC on Windows

LinGao

We build SDL with Visual studio 2017 compiler on Windows Server 2016, but it failed to build due to error LNK2019: unresolved external symbol _memset referenced in function _IMA_ADPCM_Decode on latest default branch. And we found that it can be first reproduced on ca7283111ad0 changeset. Could you please help have a look about this issue? Thanks in advance!
This commit is contained in:
Sam Lantinga 2019-06-10 08:49:26 -07:00
parent 9891c31ba0
commit d8da33c03f

View File

@ -110,7 +110,9 @@ WaveDebugLogFormat(WaveFile *file)
const char *fmtstr = "WAVE file: %s, %u Hz, %s, %u bits, %u %s/s"; const char *fmtstr = "WAVE file: %s, %u Hz, %s, %u bits, %u %s/s";
const char *waveformat, *wavechannel, *wavebpsunit = "B"; const char *waveformat, *wavechannel, *wavebpsunit = "B";
Uint32 wavebps = format->byterate; Uint32 wavebps = format->byterate;
char channelstr[64] = {0}; char channelstr[64];
SDL_zero(channelstr);
switch (format->encoding) { switch (format->encoding) {
case PCM_CODE: case PCM_CODE:
@ -641,10 +643,11 @@ MS_ADPCM_Decode(WaveFile *file, Uint8 **audio_buf, Uint32 *audio_len)
int result; int result;
size_t bytesleft, outputsize; size_t bytesleft, outputsize;
WaveChunk *chunk = &file->chunk; WaveChunk *chunk = &file->chunk;
ADPCM_DecoderState state = {0}; ADPCM_DecoderState state;
MS_ADPCM_ChannelState cstate[2]; MS_ADPCM_ChannelState cstate[2];
SDL_memset(cstate, 0, sizeof(cstate)); SDL_zero(state);
SDL_zero(cstate);
if (chunk->size != chunk->length) { if (chunk->size != chunk->length) {
/* Could not read everything. Recalculate number of sample frames. */ /* Could not read everything. Recalculate number of sample frames. */