Import of variables from DLLs

Ge van Geldorp ge at gse.nl
Tue Dec 9 12:35:01 CST 2003


ChangeLog:
  When building a PE DLL (MinGW), variables exported from a DLL
  must be explicitly marked as dllimport when using them

Gé van Geldorp.

Index: include/winnt.h
===================================================================
RCS file: /home/wine/wine/include/winnt.h,v
retrieving revision 1.175
diff -u -r1.175 winnt.h
--- include/winnt.h	4 Dec 2003 05:48:03 -0000	1.175
+++ include/winnt.h	9 Dec 2003 10:48:54 -0000
@@ -41,8 +41,14 @@
 #define WINE_UNUSED    /* nothing */
 #endif
 
-#if defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_IA64) ||
defined(_M_AMD64)) && !defined(MIDL_PASS)
-# define DECLSPEC_IMPORT __declspec(dllimport)
+#if (defined(_M_IX86) || defined(_M_IA64) || defined(_M_AMD64) ||
defined(__MINGW32__)) && !defined(MIDL_PASS)
+# if defined(_MSC_VER)
+#  define DECLSPEC_IMPORT __declspec(dllimport)
+# elif defined(__MINGW32__)
+#  define DECLSPEC_IMPORT __attribute__((dllimport))
+# else
+#  define DECLSPEC_IMPORT
+# endif
 #else
 # define DECLSPEC_IMPORT
 #endif
Index: include/wine/unicode.h
===================================================================
RCS file: /home/wine/wine/include/wine/unicode.h,v
retrieving revision 1.25
diff -u -r1.25 unicode.h
--- include/wine/unicode.h	22 Nov 2003 00:00:53 -0000	1.25
+++ include/wine/unicode.h	9 Dec 2003 10:48:55 -0000
@@ -27,6 +27,12 @@
 #include <winbase.h>
 #include <winnls.h>
 
+#ifdef BUILDING_WINE_UNICODE
+#define UNICODE_API
+#else
+#define UNICODE_API DECLSPEC_IMPORT
+#endif
+
 /* code page info common to SBCS and DBCS */
 struct cp_info
 {
@@ -95,13 +101,13 @@
 
 static inline WCHAR tolowerW( WCHAR ch )
 {
-    extern const WCHAR wine_casemap_lower[];
+    extern UNICODE_API const WCHAR wine_casemap_lower[];
     return ch + wine_casemap_lower[wine_casemap_lower[ch >> 8] + (ch &
0xff)];
 }
 
 static inline WCHAR toupperW( WCHAR ch )
 {
-    extern const WCHAR wine_casemap_upper[];
+    extern UNICODE_API const WCHAR wine_casemap_upper[];
     return ch + wine_casemap_upper[wine_casemap_upper[ch >> 8] + (ch &
0xff)];
 }
 
@@ -109,7 +115,7 @@
 /* and the C2_* type in the high 4 bits */
 static inline unsigned short get_char_typeW( WCHAR ch )
 {
-    extern const unsigned short wine_wctype_table[];
+    extern UNICODE_API const unsigned short wine_wctype_table[];
     return wine_wctype_table[wine_wctype_table[ch >> 8] + (ch & 0xff)];
 }
 
Index: libs/unicode/Makefile.in
===================================================================
RCS file: /home/wine/wine/libs/unicode/Makefile.in,v
retrieving revision 1.6
diff -u -r1.6 Makefile.in
--- libs/unicode/Makefile.in	15 Oct 2003 20:52:28 -0000	1.6
+++ libs/unicode/Makefile.in	9 Dec 2003 10:48:55 -0000
@@ -4,7 +4,7 @@
 VPATH     = @srcdir@
 LIBRARY   = wine_unicode
 SOVERSION = 1
-EXTRADEFS = -D__WINESRC__ -DNO_LIBWINE_PORT
+EXTRADEFS = -D__WINESRC__ -DNO_LIBWINE_PORT -DBUILDING_WINE_UNICODE
 
 CODEPAGES = \
 	037 \





More information about the wine-patches mailing list