You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 9, 2020. It is now read-only.
This is partly done, but there are still some thing to be finished.
If the system builds a DLL rather than a static library, the symbols to be exported from the DLL need to be identified. There are two ways of doing this:
Create a file which lists the points to be exported.
The first method means that people who only develop on Linux systems will have no clue that there is one additional step that needs to be done if a new entry point to the library is added.
I can easily do either method, and I don't think that I currently have a preference. There is no need to mark things as imports from a dll in order to link to a library. But we don't currently process cn-cbor.h to produce an internal and external version.
The text was updated successfully, but these errors were encountered:
To get the UNIX devs on board, one could start out by prefixing
__attribute__ ((visibility ("default")))
to public API symbols, and a buildscript that automatically processes the header to replace that with a proper macro definition (so as not to leave Microsoft C users behind)
/* this should cover most if not all compilers in existence that target Windows NT. Including Watcom. */#if defined(_MSC_VER) || defined(_WIN32) || defined(_WIN64) || defined(WIN32) || defined(WIN64) || defined(__NT__)
# ifdefAPI_EXPORTS# defineCNCBOR_API __declspec(dllexport)
# else# defineCNCBOR_API __declspec(dllimport)
# endif#else# ifdefAPI_EXPORTS# defineCNCBOR_API __attribute__((visibility("default")))
# else# defineCNCBOR_API# endif#endif// defined
I use Clang or GCC even on Windows, so either of these work fine on my end.
attribute ((visibility ("default"))) is not supported by all compilers. For example, the IAR ARM compiler I use does not support it, The proposed checks need to be modified to only use that for compilers that support it.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
This is partly done, but there are still some thing to be finished.
If the system builds a DLL rather than a static library, the symbols to be exported from the DLL need to be identified. There are two ways of doing this:
The second method makes it clear what is happening, but makes the code be messier so you end up with code the following in cn-cbor.h
MYLIB_EXPORT
cn_cbor* cn_cbor_map_create(CBOR_CONTEXT_COMMA cn_cbor_errback *errp);
The first method means that people who only develop on Linux systems will have no clue that there is one additional step that needs to be done if a new entry point to the library is added.
I can easily do either method, and I don't think that I currently have a preference. There is no need to mark things as imports from a dll in order to link to a library. But we don't currently process cn-cbor.h to produce an internal and external version.
The text was updated successfully, but these errors were encountered: