From bdf48cf4b567b05f73f8f2ed0c05735d2a4d0899 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Wed, 25 Nov 2026 15:21:43 +0100 Subject: Windows: Don't use dllimport; only apply dllexport to DLL objects Public headers declared the API macro as __declspec(dllimport) on Windows unless *_STATIC was defined. That made consumers reference __imp_, which only exists in the DLL import library, so linking against the static library failed unless the consumer also defined *_STATIC. All exported symbols are functions, so dllimport is not needed: calls to plain symbols link against both the static library and the import library (via its thunks). Drop it from the public headers. On the library side, apply __declspec(dllexport) only when libtool defines DLL_EXPORT, i.e. when compiling the objects for the DLL. This keeps export directives out of the objects that go into the static library when both are built. --- include/libimobiledevice-glue/glue.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'include/libimobiledevice-glue') diff --git a/include/libimobiledevice-glue/glue.h b/include/libimobiledevice-glue/glue.h index e0364e1..fae35fa 100644 --- a/include/libimobiledevice-glue/glue.h +++ b/include/libimobiledevice-glue/glue.h @@ -23,13 +23,7 @@ #define __GLUE_H #ifndef LIMD_GLUE_API - #ifdef LIMD_GLUE_STATIC - #define LIMD_GLUE_API - #elif defined(_WIN32) - #define LIMD_GLUE_API __declspec(dllimport) - #else - #define LIMD_GLUE_API - #endif + #define LIMD_GLUE_API #endif #ifdef __cplusplus -- cgit v1.1-32-gdbae