Adds function to HAL to free malloc'd joystick name (#543)

No safe way to do this with interop, so a function is needed.
This commit is contained in:
Thad House
2017-06-30 16:11:16 -07:00
committed by Peter Johnson
parent e4a918850f
commit 462b231dac
3 changed files with 4 additions and 1 deletions

View File

@@ -205,6 +205,8 @@ char* HAL_GetJoystickName(int32_t joystickNum) {
}
}
void HAL_FreeJoystickName(char* name) { std::free(name); }
int32_t HAL_GetJoystickAxisType(int32_t joystickNum, int32_t axis) {
HAL_JoystickDescriptor joystickDesc;
if (HAL_GetJoystickDescriptor(joystickNum, &joystickDesc) < 0) {