Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

evdev_gun: enable libudev on FreeBSD #13305

Merged
merged 2 commits into from Jan 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion 3rdparty/CMakeLists.txt
Expand Up @@ -142,7 +142,7 @@ add_subdirectory(SoundTouch EXCLUDE_FROM_ALL)
# libevdev
set(LIBEVDEV_TARGET 3rdparty_dummy_lib)
if(USE_LIBEVDEV)
pkg_check_modules(LIBEVDEV libevdev)
pkg_check_modules(LIBEVDEV libevdev libudev)
if(LIBEVDEV_FOUND)
add_library(3rdparty_libevdev INTERFACE)
target_compile_definitions(3rdparty_libevdev INTERFACE -DHAVE_LIBEVDEV)
Expand Down
6 changes: 0 additions & 6 deletions rpcs3/Input/evdev_gun_handler.cpp
Expand Up @@ -7,9 +7,7 @@
#include "evdev_gun_handler.h"
#include "util/logs.hpp"

#ifdef __linux__ // Too lazy to make this work for BSD
#include <libudev.h>
#endif

#include <libevdev/libevdev.h>
#include <fcntl.h>
Expand Down Expand Up @@ -95,11 +93,9 @@ evdev_gun_handler::~evdev_gun_handler()
close(fd);
}
}
#ifdef __linux__
if (m_udev != nullptr)
udev_unref(m_udev);
evdev_log.notice("Lightgun: Shutdown udev initialization");
#endif
}

int evdev_gun_handler::get_button(u32 gunno, gun_button button) const
Expand Down Expand Up @@ -204,7 +200,6 @@ bool evdev_gun_handler::init()

m_devices.clear();

#ifdef __linux__
evdev_log.notice("Lightgun: Begin udev initialization");

m_udev = udev_new();
Expand Down Expand Up @@ -317,7 +312,6 @@ bool evdev_gun_handler::init()
{
evdev_log.error("Lightgun: Failed udev enumeration");
}
#endif

m_is_init = true;
return true;
Expand Down