MSVC: handle symbol visibility
On MSVC, the exported symbols have to be marked both in the header and
in the implementation as dllexport, whereas on GCC the visibility=normal
attribute is only supposed to be used in the implementation. As a
result, we need two types of macros here, one for the public headers,
and the other for TUs with implementation. Also, the symbol name cannot
be generic ("API") because we only want to mark as dllexport those
symbols which are in a library that we're building *now*. Otherwise this
will break havoc in any libraries which also use the `ABI` macro *and*
also use libyang.
diff --git a/src/tree_schema_free.c b/src/tree_schema_free.c
index eb3c563..fdb0bd5 100644
--- a/src/tree_schema_free.c
+++ b/src/tree_schema_free.c
@@ -1041,7 +1041,7 @@
free(module);
}
-API void
+LIBYANG_API_DEF void
lyplg_ext_instance_substatements_free(struct ly_ctx *ctx, struct lysc_ext_substmt *substmts)
{
LY_ARRAY_COUNT_TYPE u;