We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4259

Summary: SDL should not export hidapi symbols
Product: SDL Reporter: Ozkan Sezer <sezeroz>
Component: joystickAssignee: Ozkan Sezer <sezeroz>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.0   
Hardware: All   
OS: Windows (All)   

Description Ozkan Sezer 2018-09-14 11:28:07 UTC
SDL2.dll built from current hg exports hidapi symbols,
it should not.  Is the following patch OK for this?

diff --git a/src/hidapi/hidapi/hidapi.h b/src/hidapi/hidapi/hidapi.h
--- a/src/hidapi/hidapi/hidapi.h
+++ b/src/hidapi/hidapi/hidapi.h
@@ -29,7 +29,7 @@
 
 #include <wchar.h>
 
-#if defined(_WIN32) && !defined(NAMESPACE)
+#if defined(_WIN32) && !defined(NAMESPACE) && (0) /* SDL: don't export hidapi syms */
       #define HID_API_EXPORT __declspec(dllexport)
       #define HID_API_CALL
 #else
Comment 1 Sam Lantinga 2018-09-17 05:59:21 UTC
Yes, that's fine. Nice catch!
Comment 2 Ozkan Sezer 2018-09-17 06:33:44 UTC
Applied: https://hg.libsdl.org/SDL/rev/3c9c784e85bb