From a748508bc91b173a2c2f810c6098e319ab75a606 Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Sat, 28 Jan 2023 09:37:08 +0000 Subject: [PATCH] evdev_gun: enable udev code on BSDs libudev is supported on DragonFly and FreeBSD, similar to libevdev. NetBSD and OpenBSD can simply disable both via -DUSE_LIBEVDEV=OFF. This reverts commit 337ee77a99ea08270f7a4dac6df18bd47ca05a33. --- 3rdparty/CMakeLists.txt | 2 +- rpcs3/Input/evdev_gun_handler.cpp | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt index b15d59106e..15aeb4f88f 100644 --- a/3rdparty/CMakeLists.txt +++ b/3rdparty/CMakeLists.txt @@ -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) diff --git a/rpcs3/Input/evdev_gun_handler.cpp b/rpcs3/Input/evdev_gun_handler.cpp index 30c9a2dad1..5e5b8d1b16 100644 --- a/rpcs3/Input/evdev_gun_handler.cpp +++ b/rpcs3/Input/evdev_gun_handler.cpp @@ -7,9 +7,7 @@ #include "evdev_gun_handler.h" #include "util/logs.hpp" -#ifdef __linux__ // Too lazy to make this work for BSD #include -#endif #include #include @@ -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 @@ -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(); @@ -317,7 +312,6 @@ bool evdev_gun_handler::init() { evdev_log.error("Lightgun: Failed udev enumeration"); } -#endif m_is_init = true; return true;