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/set.h b/src/set.h
index 9312af8..415323a 100644
--- a/src/set.h
+++ b/src/set.h
@@ -61,7 +61,7 @@
  * @return LY_EINVAL in case of NULL @p set parameter.
  * @return LY_EMEM in case of memory allocation failure.
  */
-LY_ERR ly_set_new(struct ly_set **set_p);
+LIBYANG_API_DECL LY_ERR ly_set_new(struct ly_set **set_p);
 
 /**
  * @brief Duplicate the existing set.
@@ -75,7 +75,7 @@
  * @return LY_EMEM in case of memory allocation failure.
  * @return LY_EINVAL in case of invalid parameters.
  */
-LY_ERR ly_set_dup(const struct ly_set *set, void *(*duplicator)(void *obj), struct ly_set **newset_p);
+LIBYANG_API_DECL LY_ERR ly_set_dup(const struct ly_set *set, void *(*duplicator)(void *obj), struct ly_set **newset_p);
 
 /**
  * @brief Add an object into the set
@@ -90,7 +90,7 @@
  * @return LY_EINVAL in case of invalid input parameters.
  * @return LY_EMEM in case of memory allocation failure.
  */
-LY_ERR ly_set_add(struct ly_set *set, void *object, ly_bool list, uint32_t *index_p);
+LIBYANG_API_DECL LY_ERR ly_set_add(struct ly_set *set, void *object, ly_bool list, uint32_t *index_p);
 
 /**
  * @brief Add all objects from \p src to \p trg.
@@ -107,7 +107,7 @@
  * @return LY_EINVAL in case of invalid input parameters.
  * @return LY_EMEM in case of memory allocation failure.
  */
-LY_ERR ly_set_merge(struct ly_set *trg, const struct ly_set *src, ly_bool list, void *(*duplicator)(void *obj));
+LIBYANG_API_DECL LY_ERR ly_set_merge(struct ly_set *trg, const struct ly_set *src, ly_bool list, void *(*duplicator)(void *obj));
 
 /**
  * @brief Learn whether the set contains the specified object.
@@ -117,7 +117,7 @@
  * @param[out] index_p Optional pointer to return index of the searched @p object.
  * @return Boolean value whether the @p object was found in the @p set.
  */
-ly_bool ly_set_contains(const struct ly_set *set, void *object, uint32_t *index_p);
+LIBYANG_API_DECL ly_bool ly_set_contains(const struct ly_set *set, void *object, uint32_t *index_p);
 
 /**
  * @brief Remove all objects from the set, but keep the set container for further use.
@@ -125,7 +125,7 @@
  * @param[in] set Set to clean.
  * @param[in] destructor Optional function to free the objects in the set.
  */
-void ly_set_clean(struct ly_set *set, void (*destructor)(void *obj));
+LIBYANG_API_DECL void ly_set_clean(struct ly_set *set, void (*destructor)(void *obj));
 
 /**
  * @brief Remove an object from the set.
@@ -138,7 +138,7 @@
  * @param[in] destructor Optional function to free the objects being removed.
  * @return LY_ERR return value.
  */
-LY_ERR ly_set_rm(struct ly_set *set, void *object, void (*destructor)(void *obj));
+LIBYANG_API_DECL LY_ERR ly_set_rm(struct ly_set *set, void *object, void (*destructor)(void *obj));
 
 /**
  * @brief Remove an object on the specific set index.
@@ -151,7 +151,7 @@
  * @param[in] destructor Optional function to free the objects being removed.
  * @return LY_ERR return value.
  */
-LY_ERR ly_set_rm_index(struct ly_set *set, uint32_t index, void (*destructor)(void *obj));
+LIBYANG_API_DECL LY_ERR ly_set_rm_index(struct ly_set *set, uint32_t index, void (*destructor)(void *obj));
 
 /**
  * @brief Free the ::ly_set data. If the destructor is not provided, it frees only the set structure
@@ -160,7 +160,7 @@
  * @param[in] set The set to be freed.
  * @param[in] destructor Optional function to free the objects in the set.
  */
-void ly_set_free(struct ly_set *set, void (*destructor)(void *obj));
+LIBYANG_API_DECL void ly_set_free(struct ly_set *set, void (*destructor)(void *obj));
 
 /**
  * @brief Alternative to the ::ly_set_free() for static ::ly_set objects - in contrast to ::ly_set_free()
@@ -169,7 +169,7 @@
  * @param[in] set The set to be erased.
  * @param[in] destructor Optional function to free the objects in the set.
  */
-void ly_set_erase(struct ly_set *set, void (*destructor)(void *obj));
+LIBYANG_API_DECL void ly_set_erase(struct ly_set *set, void (*destructor)(void *obj));
 
 /** @} lyset */