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/schema_compile.c b/src/schema_compile.c
index 179d3c0..f84d687 100644
--- a/src/schema_compile.c
+++ b/src/schema_compile.c
@@ -145,7 +145,7 @@
     return orig;
 }
 
-API LY_ERR
+LIBYANG_API_DEF LY_ERR
 lysc_ext_substmt(const struct lysc_ext_instance *ext, enum ly_stmt substmt, void **instance_p, enum ly_stmt_cardinality *cardinality_p)
 {
     LY_ARRAY_COUNT_TYPE u;