| Summary: | SDL failed to build due to error LNK2019: unresolved external symbol memset referenced in function SDL_SetJoystickIDForPlayerIndex with MSVC x64 on Windows | ||
|---|---|---|---|
| Product: | SDL | Reporter: | LinGao <gaolin01> |
| Component: | build | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | CC: | sezeroz |
| Version: | HG 2.1 | ||
| Hardware: | x86 | ||
| OS: | Windows 10 | ||
| Attachments: | log_x64_build | ||
|
Description
LinGao
2019-12-26 08:49:34 UTC
Here is a possible fix:
diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c
--- a/src/joystick/SDL_joystick.c
+++ b/src/joystick/SDL_joystick.c
@@ -158,9 +158,8 @@ SDL_SetJoystickIDForPlayerIndex(int play
}
SDL_joystick_players = new_players;
- while (SDL_joystick_player_count <= player_index) {
- SDL_joystick_players[SDL_joystick_player_count++] = -1;
- }
+ SDL_memset4(SDL_joystick_players, (Uint32)(-1),
+ player_index + 1 - SDL_joystick_player_count);
}
SDL_joystick_players[player_index] = instance_id;
(In reply to Ozkan Sezer from comment #1) > Here is a possible fix: My patch is obviously bad. Ignore. Fixed, thanks! https://hg.libsdl.org/SDL/rev/d06fbb1b5b78 |