--- /dev/null
+diff --git a/include/plist/plist.h b/include/plist/plist.h\r
+index 2863c74..9cdb219 100644\r
+--- a/include/plist/plist.h\r
++++ b/include/plist/plist.h\r
+@@ -42,7 +42,7 @@ extern "C"\r
+ #include <stdint.h>\r
+ #endif\r
+ \r
+-#ifdef _MSC_VER \r
++#if defined(_MSC_VER) && defined(LIBPLIST_EXPORTS)\r
+ #define PLIST_API_MSC __declspec( dllexport ) \r
+ #else \r
+ #define PLIST_API_MSC \r
+diff --git a/src/plist.h b/src/plist.h\r
+index 1e5d0d1..6690343 100644\r
+--- a/src/plist.h\r
++++ b/src/plist.h\r
+@@ -39,10 +39,7 @@\r
+ #include <sys/time.h>\r
+ #endif\r
+ \r
+-#ifdef _MSC_VER\r
+- #define PLIST_API __declspec( dllexport )\r
+-#else\r
+-#ifdef WIN32\r
++#if (defined(_MSC_VER) || defined(WIN32)) && defined(LIBPLIST_EXPORTS)\r
+ #define PLIST_API __declspec( dllexport )\r
+ #else\r
+ #ifdef HAVE_FVISIBILITY\r
+@@ -51,7 +48,6 @@\r
+ #define PLIST_API\r
+ #endif\r
+ #endif\r
+-#endif\r
+ \r
+ struct plist_data_s\r
+ {\r