SDL_hidapi_linux.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. Simple DirectMedia Layer
  3. Copyright (C) 1997-2026 Sam Lantinga <slouken@libsdl.org>
  4. This software is provided 'as-is', without any express or implied
  5. warranty. In no event will the authors be held liable for any damages
  6. arising from the use of this software.
  7. Permission is granted to anyone to use this software for any purpose,
  8. including commercial applications, and to alter it and redistribute it
  9. freely, subject to the following restrictions:
  10. 1. The origin of this software must not be misrepresented; you must not
  11. claim that you wrote the original software. If you use this software
  12. in a product, an acknowledgment in the product documentation would be
  13. appreciated but is not required.
  14. 2. Altered source versions must be plainly marked as such, and must not be
  15. misrepresented as being the original software.
  16. 3. This notice may not be removed or altered from any source distribution.
  17. */
  18. #ifdef SDL_USE_LIBUDEV
  19. static const SDL_UDEV_Symbols *udev_ctx = NULL;
  20. #define udev_device_get_devnode udev_ctx->udev_device_get_devnode
  21. #define udev_device_get_parent_with_subsystem_devtype udev_ctx->udev_device_get_parent_with_subsystem_devtype
  22. #define udev_device_get_sysattr_value udev_ctx->udev_device_get_sysattr_value
  23. #define udev_device_get_syspath udev_ctx->udev_device_get_syspath
  24. #define udev_device_new_from_devnum udev_ctx->udev_device_new_from_devnum
  25. #define udev_device_new_from_syspath udev_ctx->udev_device_new_from_syspath
  26. #define udev_device_unref udev_ctx->udev_device_unref
  27. #define udev_enumerate_add_match_subsystem udev_ctx->udev_enumerate_add_match_subsystem
  28. #define udev_enumerate_get_list_entry udev_ctx->udev_enumerate_get_list_entry
  29. #define udev_enumerate_new udev_ctx->udev_enumerate_new
  30. #define udev_enumerate_scan_devices udev_ctx->udev_enumerate_scan_devices
  31. #define udev_enumerate_unref udev_ctx->udev_enumerate_unref
  32. #define udev_list_entry_get_name udev_ctx->udev_list_entry_get_name
  33. #define udev_list_entry_get_next udev_ctx->udev_list_entry_get_next
  34. #define udev_new udev_ctx->udev_new
  35. #define udev_unref udev_ctx->udev_unref
  36. #define udev_hwdb_new udev_ctx->udev_hwdb_new
  37. #define udev_hwdb_unref udev_ctx->udev_hwdb_unref
  38. #define udev_hwdb_get_properties_list_entry udev_ctx->udev_hwdb_get_properties_list_entry
  39. #define udev_list_entry_get_value udev_ctx->udev_list_entry_get_value
  40. #undef HIDAPI_H__
  41. #define HIDAPI_ALLOW_BUILD_WORKAROUND_KERNEL_2_6_39
  42. #include "linux/hid.c"
  43. #define HAVE_PLATFORM_BACKEND 1
  44. #endif /* SDL_USE_LIBUDEV */