Merge remote-tracking branch 'diverent/freebsd'

# Conflicts:
#	README.md
#	src/CMakeLists.txt
#	src/wl_platform.h
#	src/x11_init.c
#	src/x11_platform.h
#	src/x11_window.c
This commit is contained in:
Reece Wilson 2023-11-05 15:15:08 +00:00
commit 5e1d820af1
5 changed files with 16 additions and 2 deletions

View File

@ -333,7 +333,7 @@ GLFWbool _glfwInitJoysticksLinux(void)
// Continue without device connection notifications if inotify fails
if (regcomp(&_glfw.linjs.regex, "^event[0-9]\\+$", 0) != 0)
if (regcomp(&_glfw.linjs.regex, "^event[0-9][0-9]*$", 0) != 0)
{
_glfwInputError(GLFW_PLATFORM_ERROR, "Linux: Failed to compile regex");
return GLFW_FALSE;

View File

@ -25,7 +25,11 @@
//========================================================================
#include <linux/input.h>
#ifdef __linux__
#include <linux/limits.h>
#else
#include <limits.h>
#endif
#include <regex.h>
#define GLFW_LINUX_JOYSTICK_STATE _GLFWjoystickLinux linjs;

View File

@ -44,6 +44,11 @@ typedef struct VkWaylandSurfaceCreateInfoKHR
typedef VkResult (APIENTRY *PFN_vkCreateWaylandSurfaceKHR)(VkInstance,const VkWaylandSurfaceCreateInfoKHR*,const VkAllocationCallbacks*,VkSurfaceKHR*);
typedef VkBool32 (APIENTRY *PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR)(VkPhysicalDevice,uint32_t,struct wl_display*);
#if defined(__linux__) || defined(__FreeBSD__)
#include "linux_joystick.h"
#else
#include "null_joystick.h"
#endif
#include "xkb_unicode.h"
#include "posix_poll.h"

View File

@ -463,6 +463,11 @@ typedef VkBool32 (APIENTRY *PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR)(Vk
#include "xkb_unicode.h"
#include "posix_poll.h"
#if defined(__linux__) || defined(__FreeBSD__)
#include "linux_joystick.h"
#else
#include "null_joystick.h"
#endif
#define GLFW_X11_WINDOW_STATE _GLFWwindowX11 x11;
#define GLFW_X11_LIBRARY_WINDOW_STATE _GLFWlibraryX11 x11;

View File

@ -3018,7 +3018,7 @@ void _glfwPollEventsX11(void)
{
drainEmptyEvents();
#if defined(GLFW_BUILD_LINUX_JOYSTICK)
#if defined(__linux__) || defined(__FreeBSD__)
if (_glfw.joysticksInitialized)
_glfwDetectJoystickConnectionLinux();
#endif