Re: git: 749318f2ae56 - main - libusb: capsicumize libusb
Joerg Wunsch <[email protected]>
| Newsgroups | gmane.os.freebsd.devel.cvs.src |
|---|---|
| Message-ID | <aoXqZrNjN84jeHAG__14056.2558708311$1787161223$gmane$org@uriah.heep.sax.de> |
Too bad this changes the API of libusb 2.0 in an incompatible way. I have an (external) application that uses libusb 2.0 when it is being compiled on FreeBSD (AVaRICE) which now breaks. Nobody ever declared that the libusb 2.0 API were a FreeBSD-internal one only not to be used by outside code. Could I convince people to at least add a version ID macro to the public header file that can be used to test the API level? Like #define LIBUSB20_VERSION 202608 That would allow constructs like #if defined(LIBUSB20_VERSION) && (LIBUSB20_VERSION >= 202608) // use libusb20_be_ctx here #endif (Sorry, I missed the review server item before.) As ShengYi Hung wrote: > @@ -294,11 +295,13 @@ int libusb20_be_set_template(struct libusb20_backend *pbe, int temp); > > /* USB backend operations */ > > -struct libusb20_backend *libusb20_be_alloc(const struct libusb20_backend_methods *methods); > -struct libusb20_backend *libusb20_be_alloc_default(void); > -struct libusb20_backend *libusb20_be_alloc_freebsd(void); > -struct libusb20_backend *libusb20_be_alloc_linux(void); > -struct libusb20_backend *libusb20_be_alloc_ugen20(void); > +struct libusb20_backend *libusb20_be_alloc(const struct libusb20_backend_methods *methods, struct libusb20_be_ctx *pctx); > +struct libusb20_backend *libusb20_be_alloc_default(struct libusb20_be_ctx *pctx); > +struct libusb20_backend *libusb20_be_alloc_freebsd(struct libusb20_be_ctx *pctx); > +struct libusb20_backend *libusb20_be_alloc_linux(struct libusb20_be_ctx *pctx); > +struct libusb20_backend *libusb20_be_alloc_ugen20(struct libusb20_be_ctx *pctx); > +struct libusb20_be_ctx *libusb20_be_ctx_alloc(void); > +void libusb20_be_ctx_free(struct libusb20_be_ctx *pctx); > struct libusb20_device *libusb20_be_device_foreach(struct libusb20_backend *pbe, struct libusb20_device *pdev); > void libusb20_be_dequeue_device(struct libusb20_backend *pbe, struct libusb20_device *pdev); > void libusb20_be_enqueue_device(struct libusb20_backend *pbe, struct libusb20_device *pdev); -- cheers, Joerg .-.-. --... ...-- -.. . DL8DTL http://www.sax.de/~joerg/ Never trust an operating system you don't have sources for. ;-)