| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. | |
| 3 * | |
| 4 * Use of this source code is governed by a BSD-style license | |
| 5 * that can be found in the LICENSE file in the root of the source | |
| 6 * tree. An additional intellectual property rights grant can be found | |
| 7 * in the file PATENTS. All contributing project authors may | |
| 8 * be found in the AUTHORS file in the root of the source tree. | |
| 9 */ | |
| 10 | |
| 11 #ifndef WEBRTC_MEDIA_DEVICES_LIBUDEVSYMBOLTABLE_H_ | |
| 12 #define WEBRTC_MEDIA_DEVICES_LIBUDEVSYMBOLTABLE_H_ | |
| 13 | |
| 14 #include <libudev.h> | |
| 15 | |
| 16 #include "webrtc/base/latebindingsymboltable.h" | |
| 17 | |
| 18 namespace cricket { | |
| 19 | |
| 20 #define LIBUDEV_SYMBOLS_CLASS_NAME LibUDevSymbolTable | |
| 21 // The libudev symbols we need, as an X-Macro list. | |
| 22 // This list must contain precisely every libudev function that is used in | |
| 23 // linuxdevicemanager.cc. | |
| 24 #define LIBUDEV_SYMBOLS_LIST \ | |
| 25 X(udev_device_get_devnode) \ | |
| 26 X(udev_device_get_parent_with_subsystem_devtype) \ | |
| 27 X(udev_device_get_sysattr_value) \ | |
| 28 X(udev_device_new_from_syspath) \ | |
| 29 X(udev_device_unref) \ | |
| 30 X(udev_enumerate_add_match_subsystem) \ | |
| 31 X(udev_enumerate_get_list_entry) \ | |
| 32 X(udev_enumerate_new) \ | |
| 33 X(udev_enumerate_scan_devices) \ | |
| 34 X(udev_enumerate_unref) \ | |
| 35 X(udev_list_entry_get_name) \ | |
| 36 X(udev_list_entry_get_next) \ | |
| 37 X(udev_monitor_enable_receiving) \ | |
| 38 X(udev_monitor_filter_add_match_subsystem_devtype) \ | |
| 39 X(udev_monitor_get_fd) \ | |
| 40 X(udev_monitor_new_from_netlink) \ | |
| 41 X(udev_monitor_receive_device) \ | |
| 42 X(udev_monitor_unref) \ | |
| 43 X(udev_new) \ | |
| 44 X(udev_unref) | |
| 45 | |
| 46 #define LATE_BINDING_SYMBOL_TABLE_CLASS_NAME LIBUDEV_SYMBOLS_CLASS_NAME | |
| 47 #define LATE_BINDING_SYMBOL_TABLE_SYMBOLS_LIST LIBUDEV_SYMBOLS_LIST | |
| 48 #include "webrtc/base/latebindingsymboltable.h.def" | |
| 49 #undef LATE_BINDING_SYMBOL_TABLE_CLASS_NAME | |
| 50 #undef LATE_BINDING_SYMBOL_TABLE_SYMBOLS_LIST | |
| 51 | |
| 52 // libudev has changed ABIs to libudev.so.1 in recent distros and lots of users | |
| 53 // and/or software (including Google Chrome) are symlinking the old to the new. | |
| 54 // The entire point of ABI versions is that you can't safely do that, and | |
| 55 // it has caused crashes in the wild. This function checks if the DllHandle that | |
| 56 // we got back for libudev.so.0 is actually for libudev.so.1. If so, the library | |
| 57 // cannot safely be used. | |
| 58 bool IsWrongLibUDevAbiVersion(rtc::DllHandle libudev_0); | |
| 59 | |
| 60 } // namespace cricket | |
| 61 | |
| 62 #endif // WEBRTC_MEDIA_DEVICES_LIBUDEVSYMBOLTABLE_H_ | |
| OLD | NEW |