Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

windows: Have a separate definition flag for export #515

Merged
merged 1 commit into from
Mar 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions hidapi/hidapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,17 @@

#include <wchar.h>

/* #480: this is to be refactored properly for v1.0 */
#ifdef _WIN32
/* #480: this is to be refactored properly for v1.0 */
#ifndef HID_API_EXPORT
#ifndef HID_API_NO_EXPORT_DEFINE
#define HID_API_EXPORT __declspec(dllexport)
#endif
#define HID_API_CALL
#else
#ifndef HID_API_EXPORT
#define HID_API_EXPORT /**< API export macro */
#endif
#define HID_API_CALL /**< API call macro */
#endif
#ifndef HID_API_EXPORT
#define HID_API_EXPORT /**< API export macro */
#endif
/* To be removed in v1.0 */
#define HID_API_CALL /**< API call macro */

#define HID_API_EXPORT_CALL HID_API_EXPORT HID_API_CALL /**< API export and call macro*/

Expand Down
2 changes: 1 addition & 1 deletion windows/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if(NOT BUILD_SHARED_LIBS)
target_compile_definitions(hidapi_winapi
# prevent marking functions as __declspec(dllexport) for static library build
# #480: this should be refactored for v1.0
PUBLIC HID_API_EXPORT
PUBLIC HID_API_NO_EXPORT_DEFINE
)
endif()

Expand Down