--- lib\stringprep.h.in	2007-07-31 11:26:07.000000000 +0200
+++ lib\stringprep.h.in.orig	2007-08-22 09:50:57.375000000 +0200
@@ -31,6 +31,17 @@
 #include <unistd.h>		/* ssize_t */
 #include <idn-int.h>		/* uint32_t */
 
+// we need this little hack to export/import data properly
+#ifdef _WIN32
+# ifdef BUILD_LIBIDN_LIB
+#  define LIBIDN_DATA_EXPORT extern const
+# else
+#  define LIBIDN_DATA_EXPORT __declspec(dllimport)
+# endif
+#else
+# define LIBIDN_DATA_EXPORT extern const
+#endif
+
 #define STRINGPREP_VERSION "@PACKAGE_VERSION@"
 
 /* Error codes. */
@@ -99,30 +110,30 @@
   };
   typedef struct Stringprep_profiles Stringprep_profiles;
 
-  extern const Stringprep_profiles stringprep_profiles[];
+  LIBIDN_DATA_EXPORT Stringprep_profiles stringprep_profiles[];
 
 /* Profiles */
-  extern const Stringprep_table_element stringprep_rfc3454_A_1[];
-  extern const Stringprep_table_element stringprep_rfc3454_B_1[];
-  extern const Stringprep_table_element stringprep_rfc3454_B_2[];
-  extern const Stringprep_table_element stringprep_rfc3454_B_3[];
-  extern const Stringprep_table_element stringprep_rfc3454_C_1_1[];
-  extern const Stringprep_table_element stringprep_rfc3454_C_1_2[];
-  extern const Stringprep_table_element stringprep_rfc3454_C_2_1[];
-  extern const Stringprep_table_element stringprep_rfc3454_C_2_2[];
-  extern const Stringprep_table_element stringprep_rfc3454_C_3[];
-  extern const Stringprep_table_element stringprep_rfc3454_C_4[];
-  extern const Stringprep_table_element stringprep_rfc3454_C_5[];
-  extern const Stringprep_table_element stringprep_rfc3454_C_6[];
-  extern const Stringprep_table_element stringprep_rfc3454_C_7[];
-  extern const Stringprep_table_element stringprep_rfc3454_C_8[];
-  extern const Stringprep_table_element stringprep_rfc3454_C_9[];
-  extern const Stringprep_table_element stringprep_rfc3454_D_1[];
-  extern const Stringprep_table_element stringprep_rfc3454_D_2[];
+  LIBIDN_DATA_EXPORT Stringprep_table_element stringprep_rfc3454_A_1[];
+  LIBIDN_DATA_EXPORT Stringprep_table_element stringprep_rfc3454_B_1[];
+  LIBIDN_DATA_EXPORT Stringprep_table_element stringprep_rfc3454_B_2[];
+  LIBIDN_DATA_EXPORT Stringprep_table_element stringprep_rfc3454_B_3[];
+  LIBIDN_DATA_EXPORT Stringprep_table_element stringprep_rfc3454_C_1_1[];
+  LIBIDN_DATA_EXPORT Stringprep_table_element stringprep_rfc3454_C_1_2[];
+  LIBIDN_DATA_EXPORT Stringprep_table_element stringprep_rfc3454_C_2_1[];
+  LIBIDN_DATA_EXPORT Stringprep_table_element stringprep_rfc3454_C_2_2[];
+  LIBIDN_DATA_EXPORT Stringprep_table_element stringprep_rfc3454_C_3[];
+  LIBIDN_DATA_EXPORT Stringprep_table_element stringprep_rfc3454_C_4[];
+  LIBIDN_DATA_EXPORT Stringprep_table_element stringprep_rfc3454_C_5[];
+  LIBIDN_DATA_EXPORT Stringprep_table_element stringprep_rfc3454_C_6[];
+  LIBIDN_DATA_EXPORT Stringprep_table_element stringprep_rfc3454_C_7[];
+  LIBIDN_DATA_EXPORT Stringprep_table_element stringprep_rfc3454_C_8[];
+  LIBIDN_DATA_EXPORT Stringprep_table_element stringprep_rfc3454_C_9[];
+  LIBIDN_DATA_EXPORT Stringprep_table_element stringprep_rfc3454_D_1[];
+  LIBIDN_DATA_EXPORT Stringprep_table_element stringprep_rfc3454_D_2[];
 
   /* Nameprep */
 
-  extern const Stringprep_profile stringprep_nameprep[];
+  LIBIDN_DATA_EXPORT Stringprep_profile stringprep_nameprep[];
 
 #define stringprep_nameprep(in, maxlen)			\
   stringprep(in, maxlen, 0, stringprep_nameprep)
@@ -132,25 +143,25 @@
 
   /* SASL */
 
-  extern const Stringprep_profile stringprep_saslprep[];
-  extern const Stringprep_profile stringprep_plain[];
-  extern const Stringprep_profile stringprep_trace[];
+  LIBIDN_DATA_EXPORT Stringprep_profile stringprep_saslprep[];
+  LIBIDN_DATA_EXPORT Stringprep_profile stringprep_plain[];
+  LIBIDN_DATA_EXPORT Stringprep_profile stringprep_trace[];
 
 #define stringprep_plain(in, maxlen)		\
   stringprep(in, maxlen, 0, stringprep_plain)
 
   /* Kerberos */
 
-  extern const Stringprep_profile stringprep_kerberos5[];
+  LIBIDN_DATA_EXPORT Stringprep_profile stringprep_kerberos5[];
 
 #define stringprep_kerberos5(in, maxlen)		\
   stringprep(in, maxlen, 0, stringprep_kerberos5)
 
   /* XMPP */
 
-  extern const Stringprep_profile stringprep_xmpp_nodeprep[];
-  extern const Stringprep_profile stringprep_xmpp_resourceprep[];
-  extern const Stringprep_table_element stringprep_xmpp_nodeprep_prohibit[];
+  LIBIDN_DATA_EXPORT Stringprep_profile stringprep_xmpp_nodeprep[];
+  LIBIDN_DATA_EXPORT Stringprep_profile stringprep_xmpp_resourceprep[];
+  LIBIDN_DATA_EXPORT Stringprep_table_element stringprep_xmpp_nodeprep_prohibit[];
 
 #define stringprep_xmpp_nodeprep(in, maxlen)		\
   stringprep(in, maxlen, 0, stringprep_xmpp_nodeprep)
@@ -159,7 +170,7 @@
 
   /* iSCSI */
 
-  extern const Stringprep_profile stringprep_iscsi[];
+  LIBIDN_DATA_EXPORT Stringprep_profile stringprep_iscsi[];
 
 #define stringprep_iscsi(in, maxlen)		\
   stringprep(in, maxlen, 0, stringprep_iscsi)
--- lib\Makefile.in	2007-08-22 09:51:31.796000000 +0200
+++ lib\Makefile.in.orig	2007-08-22 09:57:10.093750000 +0200
@@ -163,7 +163,7 @@
 CXXDEPMODE = @CXXDEPMODE@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
-DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
+DEFS = -DLOCALEDIR=\"$(localedir)\" -DBUILD_LIBIDN_LIB @DEFS@
 DEPDIR = @DEPDIR@
 DLLTOOL = @DLLTOOL@
 ECHO = @ECHO@
--- lib\Makefile.am	2007-08-22 09:42:39.843750000 +0200
+++ lib\Makefile.am.orig	2007-08-22 10:01:39.296875000 +0200
@@ -21,7 +21,7 @@
 EXTRA_DIST = gen-stringprep-tables.pl gen-unicode-tables.pl gen-tld-tables.pl
 
 AM_CPPFLAGS = -I$(srcdir)/gl -Igl
-DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
+DEFS = -DLOCALEDIR=\"$(localedir)\" -DBUILD_LIBIDN_LIB @DEFS@
 
 lib_LTLIBRARIES = libidn.la
 
