diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2013-04-08 11:20:21 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2013-04-08 11:20:21 +0200 |
commit | 8ef814812b93b2039b89f8a107d45c2ec21b2a8e (patch) | |
tree | c5cac911b1d3fd7a34fb6524011f9b70b1277356 /libusbhp/libusbhp.cc | |
parent | 236638cd8731712e3446ba2db8b5e952c9589a7e (diff) | |
parent | b8c9e442a9313f27670dcae97757b3c416ac263d (diff) |
Merge branch 'master' of http://git.aasimon.org/public/libusbhp
Diffstat (limited to 'libusbhp/libusbhp.cc')
-rw-r--r-- | libusbhp/libusbhp.cc | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/libusbhp/libusbhp.cc b/libusbhp/libusbhp.cc index 9e79220..4058c10 100644 --- a/libusbhp/libusbhp.cc +++ b/libusbhp/libusbhp.cc @@ -28,7 +28,6 @@ #ifdef __linux__ #include <poll.h> -#include <libudev.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -53,7 +52,13 @@ #endif/*_WIN32*/ +#ifdef __cplusplus +extern "C" { +#endif + #ifdef __linux__ +#include <libudev.h> + struct dev_list_t { char *path; unsigned short vid; @@ -105,13 +110,13 @@ static void dev_list_add(struct libusbhp_t *h, const char *path, static int dev_list_remove(struct libusbhp_t *h, const char *path) { struct dev_list_t *p = h->devlist; - if(!p) return; + if(!p) return 1; if(!strcmp(p->path, path)) { h->devlist = p->next; free(p->path); free(p); - return; + return 0; } while(p->next) { @@ -438,3 +443,7 @@ void libusbhp_register_hotplug_listeners(struct libusbhp_t *handle, handle->detach = disconnected_cb; handle->user_data = user_data; } + +#ifdef __cplusplus +} +#endif |