From 3f8cf55f143828a4ada0b2446ea6fcdcf595ed60 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Tue, 26 Mar 2013 06:40:17 -0400 Subject: Fixed compilation with autotools. --- libusbhp/libusbhp.cc | 15 ++++++++++++--- libusbhp/libusbhp.h | 8 ++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) (limited to 'libusbhp') 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 -#include #include #include #include @@ -53,7 +52,13 @@ #endif/*_WIN32*/ +#ifdef __cplusplus +extern "C" { +#endif + #ifdef __linux__ +#include + 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 diff --git a/libusbhp/libusbhp.h b/libusbhp/libusbhp.h index ccf7125..7622576 100644 --- a/libusbhp/libusbhp.h +++ b/libusbhp/libusbhp.h @@ -41,6 +41,11 @@ #include #endif +#ifdef __cplusplus +extern "C" { +#endif + + struct libusbhp_t; struct libusbhp_device_t { @@ -66,6 +71,9 @@ EXPORT libusbhp_hotplug_cb_fn disconnected_cb, void *user_data); +#ifdef __cplusplus +} +#endif /*** // Libusbx implementation: -- cgit v1.2.3 From 0035e5cc347a07827808ee99a1ecbd4640a4b37c Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Tue, 26 Mar 2013 13:16:45 +0100 Subject: Fix release build in visual studio. --- libusbhp/libusbhp.vcxproj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libusbhp') diff --git a/libusbhp/libusbhp.vcxproj b/libusbhp/libusbhp.vcxproj index fd5527c..6dca199 100644 --- a/libusbhp/libusbhp.vcxproj +++ b/libusbhp/libusbhp.vcxproj @@ -73,13 +73,14 @@ MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBUSBHOTPLUG_EXPORTS;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBUSBHOTPLUG_EXPORTS;BUILD_DLL;%(PreprocessorDefinitions) Windows true true true + setupapi.lib;%(AdditionalDependencies) -- cgit v1.2.3 From b8c9e442a9313f27670dcae97757b3c416ac263d Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Tue, 26 Mar 2013 08:21:05 -0400 Subject: Added visual studio project files to dist. --- libusbhp/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libusbhp') diff --git a/libusbhp/Makefile.am b/libusbhp/Makefile.am index 785a34d..e24a51f 100644 --- a/libusbhp/Makefile.am +++ b/libusbhp/Makefile.am @@ -8,3 +8,5 @@ libusbhp_la_SOURCES = \ include_HEADERS = \ libusbhp.h + +EXTRA_DIST = libusbhp.vcxproj \ No newline at end of file -- cgit v1.2.3