Fix YAML_DECLARE macro for MINGW32 architecture.
MinGW declares WIN32. Since `YAML_DECLARE_STATIC` isn't declared
before yaml.h is included, `YAML_DECLARE` will expand to
define YAML_DECLARE(type) __declspec(dllexport) type
which doesn't work with MinGW, instead you would end up with
undefined references to `_impl__yaml_*`. Checking whether you're
currently in a MINGW32 setting fixes that behaviour.
commit22dee7bc50a33f3d524cf5e71e92270e7938e009
authorBenjamin Kaestner <benjamin.kaestner@gmail.com>
dateFri 7 Feb 2014, 00:54 (13 years ago)
parentd9b4850
libyaml/yaml.h+3−1
@@ -26,7 +26,9 @@ extern "C" {
2626
2727/** The public API declaration. */
2828
29−#ifdef _WIN32
29+#if defined(__MINGW32__)
30+# define YAML_DECLARE(type) type
31+#elif defined(_WIN32)
3032# if defined(YAML_DECLARE_STATIC)
3133# define YAML_DECLARE(type) type
3234# elif defined(YAML_DECLARE_EXPORT)