Commit 1442e464 authored by Alois Klink's avatar Alois Klink Committed by Andreas Schneider
Browse files

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: default avatarAndreas Schneider <asn@cryptomilk.org>
parent 1b019882
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment