-#if defined(HAVE_WIN32_DLL_SUPPORT) && !defined(DONT_WANT_WIN32_DLL_SUPPORT)
-#define ENABLE_WIN32_DLL_SUPPORT
-#endif
-
-#ifdef ENABLE_WIN32_DLL_SUPPORT
-# if __GNUC__ && !defined(__declspec)
-# define DLLIMPORT
-# else
-# define DLLIMPORT __declspec(dllimport)
-# define DLLIMPORT_DATA(x) _imp__##x
-# endif
+#if defined(__PIC__) && defined(mingw32_TARGET_OS)
+# define DLL_IMPORT_DATA_REF(x) (_imp__##x)
+# define DLL_IMPORT_DATA_VARNAME(x) *_imp__##x
+# if __GNUC__ && !defined(__declspec)
+# define DLLIMPORT
+# else
+# define DLLIMPORT __declspec(dllimport)
+# define DLLIMPORT_DATA(x) _imp__##x
+# endif