include: add CMOCKA_DLLEXTERN for MSVC DLLs
Add a new macro called `CMOCKA_DLLEXTERN` that represents Windows DLL storage class specifiers. Essentially, in order to publically export some data in a DLL, you must either declare the function/data with `__declspec(dllexport)`, or list the function/data in a `.def` file (which is what the CMocka project does). In order to import functions from a DLL, `__declspec(dllimport)` may be used for a performance increase. However, **`__declspec(dllimport)` is required for importing data from a DLL**! The new `CMOCKA_DLLEXTERN` macro takes care of this for us, when we're using MSVC. See https://github.com/MicrosoftDocs/cpp-docs/blob/main/docs/cpp/definitions-and-declarations-cpp.md Reviewed-by:Andreas Schneider <asn@cryptomilk.org>
parent
1b019882
Please register or sign in to comment