Skip to content

Commit 93f676b

Browse files
committed
drivers/Makefile.am, drivers/libusb0.c, drivers/libusb1.c: fix linking of suggest_NDE_conflict() when we ENABLE_SHARED_PRIVATE_LIBS [#2800]
Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
1 parent e309aba commit 93f676b

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

drivers/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ libdummy_serial_la_LIBADD = $(top_builddir)/common/libnutprivate-@NUT_SOURCE_GIT
568568

569569
# Note: unlike SERLIBS that are usually part of the system one way or another, LIBUSB_LIBS are typically shared:
570570
libdummy_libusb_la_LIBADD = $(top_builddir)/common/libnutprivate-@NUT_SOURCE_GITREV_SEMVER_UNDERSCORES@-common-all.la $(LIBUSB_LIBS)
571-
libdummy_libusb_la_CFLAGS = $(AM_CFLAGS) $(LIBUSB_CFLAGS)
571+
libdummy_libusb_la_CFLAGS = $(AM_CFLAGS) $(LIBUSB_CFLAGS) -DBUILD_FOR_SHARED_PRIVATE_LIBS=1
572572

573573
else !ENABLE_SHARED_PRIVATE_LIBS
574574

drivers/libusb0.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@
3030
* -------------------------------------------------------------------------- */
3131

3232
#include "config.h" /* for HAVE_USB_DETACH_KERNEL_DRIVER_NP flag */
33+
34+
#if (defined ENABLE_SHARED_PRIVATE_LIBS) && ENABLE_SHARED_PRIVATE_LIBS
35+
# if (defined BUILD_FOR_SHARED_PRIVATE_LIBS) && BUILD_FOR_SHARED_PRIVATE_LIBS
36+
# define suggest_NDE_conflict LIBNUTPRIVATE_suggest_NDE_conflict
37+
/* else: would need to pass method pointer like in main.c, too much
38+
* hassle for a mixed-dynamicity build that might never happen */
39+
# endif
40+
#endif
41+
3342
#include "common.h" /* for xmalloc, upsdebugx prototypes */
3443
#include "usb-common.h"
3544
#include "nut_libusb.h"
@@ -38,7 +47,7 @@
3847
#endif /* WIN32 */
3948

4049
#define USB_DRIVER_NAME "USB communication driver (libusb 0.1)"
41-
#define USB_DRIVER_VERSION "0.52"
50+
#define USB_DRIVER_VERSION "0.53"
4251

4352
/* driver description structure */
4453
upsdrv_info_t comm_upsdrv_info = {

drivers/libusb1.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,22 @@
2727
* -------------------------------------------------------------------------- */
2828

2929
#include "config.h" /* for HAVE_LIBUSB_DETACH_KERNEL_DRIVER flag */
30+
31+
#if (defined ENABLE_SHARED_PRIVATE_LIBS) && ENABLE_SHARED_PRIVATE_LIBS
32+
# if (defined BUILD_FOR_SHARED_PRIVATE_LIBS) && BUILD_FOR_SHARED_PRIVATE_LIBS
33+
# define suggest_NDE_conflict LIBNUTPRIVATE_suggest_NDE_conflict
34+
/* else: would need to pass method pointer like in main.c, too much
35+
* hassle for a mixed-dynamicity build that might never happen */
36+
# endif
37+
#endif
38+
3039
#include "common.h" /* for xmalloc, upsdebugx prototypes */
3140
#include "usb-common.h"
3241
#include "nut_libusb.h"
3342
#include "nut_stdint.h"
3443

3544
#define USB_DRIVER_NAME "USB communication driver (libusb 1.0)"
36-
#define USB_DRIVER_VERSION "0.52"
45+
#define USB_DRIVER_VERSION "0.53"
3746

3847
/* driver description structure */
3948
upsdrv_info_t comm_upsdrv_info = {

0 commit comments

Comments
 (0)