OpenIDC / cjose

C library implementing the Javascript Object Signing and Encryption (JOSE)
MIT License
16 stars 6 forks source link

Windows DLL support #24

Closed marcstern closed 3 weeks ago

marcstern commented 2 months ago

Current code is incompatible with Windows DLL. Solution is simple. In .H files:

#ifdef WIN32
# ifdef CJOSE_BUILD
#  define CJOSE_EXTERN __declspec(dllexport)
# else
#  define CJOSE_EXTERN __declspec(dllimport)
# endif
#else
# define CJOSE_EXTERN
#endif
[...]
CJOSE_EXTERN const char *CJOSE_HDR_ALG;

Example is for CJOSE_HDR_ALG, but should be added to all exported symbols. The #ifdef WIN32 has to be included once in a central file obviously.

Could we expect this? Thanks a lot

zandbelt commented 3 weeks ago

since the Windows build requires other Windows-specific files as well I suggest to keep this in a fork

marcstern commented 3 weeks ago

I build it in Windows with only that addition