diff --git a/src/SFML/Window/macOS/JoystickImpl.cpp b/src/SFML/Window/macOS/JoystickImpl.cpp index 8155096ba..87d776182 100644 --- a/src/SFML/Window/macOS/JoystickImpl.cpp +++ b/src/SFML/Window/macOS/JoystickImpl.cpp @@ -38,10 +38,6 @@ namespace { -bool joystickButtonSortPredicate(IOHIDElementRef b1, IOHIDElementRef b2) -{ - return IOHIDElementGetUsage(b1) < IOHIDElementGetUsage(b2); -} // Convert a CFStringRef to std::string std::string stringFromCFString(CFStringRef cfString) @@ -320,7 +316,9 @@ bool JoystickImpl::open(unsigned int index) // Ensure that the buttons will be indexed in the same order as their // HID Usage (assigned by manufacturer and/or a driver). - std::sort(m_buttons.begin(), m_buttons.end(), joystickButtonSortPredicate); + std::sort(m_buttons.begin(), + m_buttons.end(), + [](IOHIDElementRef b1, IOHIDElementRef b2) { return IOHIDElementGetUsage(b1) < IOHIDElementGetUsage(b2); }); // Retain all these objects for personal use for (IOHIDElementRef iohidElementRef : m_buttons)