portability fixes (yet another attempt)

Thomas Weidenmueller wine-patches at reactsoft.com
Tue Feb 15 20:05:46 CST 2005


As my previous two patches were completely wrong (I'm sorry for 
submitting them), this patch should make msi, oleaut32, setupapi, 
shlwapi more portable (so reactos can compile and link them without 
libunicode dependencies).

I'm however not sure about the changes in include/wine/port.h and 
include/config.h so please adjust or correct them so it builds correctly.

Best Regards,
Thomas
-------------- next part --------------
Index: dlls/msi/msiquery.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/msiquery.c,v
retrieving revision 1.23
diff -u -r1.23 msiquery.c
--- dlls/msi/msiquery.c	8 Feb 2005 13:44:25 -0000	1.23
+++ dlls/msi/msiquery.c	16 Feb 2005 01:34:14 -0000
@@ -18,6 +18,10 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#include "config.h"
+#include "wine/port.h"
+
+
 #include <stdarg.h>
 
 #define COBJMACROS
Index: dlls/oleaut32/vartype.c
===================================================================
RCS file: /home/wine/wine/dlls/oleaut32/vartype.c,v
retrieving revision 1.11
diff -u -r1.11 vartype.c
--- dlls/oleaut32/vartype.c	7 Oct 2004 02:59:45 -0000	1.11
+++ dlls/oleaut32/vartype.c	16 Feb 2005 01:34:19 -0000
@@ -18,6 +18,10 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#include "config.h"
+#include "wine/port.h"
+
+
 #define COBJMACROS
 #define NONAMELESSUNION
 #define NONAMELESSSTRUCT
Index: dlls/setupapi/install.c
===================================================================
RCS file: /home/wine/wine/dlls/setupapi/install.c,v
retrieving revision 1.12
diff -u -r1.12 install.c
--- dlls/setupapi/install.c	30 Nov 2004 21:38:59 -0000	1.12
+++ dlls/setupapi/install.c	16 Feb 2005 01:31:37 -0000
@@ -18,6 +18,10 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#include "config.h"
+#include "wine/port.h"
+
+
 #include <stdarg.h>
 
 #include "windef.h"
Index: dlls/shlwapi/ordinal.c
===================================================================
RCS file: /home/wine/wine/dlls/shlwapi/ordinal.c,v
retrieving revision 1.104
diff -u -r1.104 ordinal.c
--- dlls/shlwapi/ordinal.c	15 Feb 2005 21:51:07 -0000	1.104
+++ dlls/shlwapi/ordinal.c	16 Feb 2005 01:40:50 -0000
@@ -20,6 +20,10 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#include "config.h"
+#include "wine/port.h"
+
+
 #define COM_NO_WINDOWS_H
 #include "config.h"
 #include "wine/port.h"
@@ -681,74 +685,6 @@
 }
 
 /*************************************************************************
- *      @	[SHLWAPI.25]
- *
- * Determine if a Unicode character is alphabetic.
- *
- * PARAMS
- *  wc [I] Character to check.
- *
- * RETURNS
- *  TRUE, if wc is alphabetic,
- *  FALSE otherwise.
- */
-BOOL WINAPI IsCharAlphaWrapW(WCHAR wc)
-{
-    return (get_char_typeW(wc) & C1_ALPHA) != 0;
-}
-
-/*************************************************************************
- *      @	[SHLWAPI.26]
- *
- * Determine if a Unicode character is upper-case.
- *
- * PARAMS
- *  wc [I] Character to check.
- *
- * RETURNS
- *  TRUE, if wc is upper-case,
- *  FALSE otherwise.
- */
-BOOL WINAPI IsCharUpperWrapW(WCHAR wc)
-{
-    return (get_char_typeW(wc) & C1_UPPER) != 0;
-}
-
-/*************************************************************************
- *      @	[SHLWAPI.27]
- *
- * Determine if a Unicode character is lower-case.
- *
- * PARAMS
- *  wc [I] Character to check.
- *
- * RETURNS
- *  TRUE, if wc is lower-case,
- *  FALSE otherwise.
- */
-BOOL WINAPI IsCharLowerWrapW(WCHAR wc)
-{
-    return (get_char_typeW(wc) & C1_LOWER) != 0;
-}
-
-/*************************************************************************
- *      @	[SHLWAPI.28]
- *
- * Determine if a Unicode character is alphabetic or a digit.
- *
- * PARAMS
- *  wc [I] Character to check.
- *
- * RETURNS
- *  TRUE, if wc is alphabetic or a digit,
- *  FALSE otherwise.
- */
-BOOL WINAPI IsCharAlphaNumericWrapW(WCHAR wc)
-{
-    return (get_char_typeW(wc) & (C1_ALPHA|C1_DIGIT)) != 0;
-}
-
-/*************************************************************************
  *      @	[SHLWAPI.29]
  *
  * Determine if a Unicode character is a space.
@@ -762,7 +698,9 @@
  */
 BOOL WINAPI IsCharSpaceW(WCHAR wc)
 {
-    return (get_char_typeW(wc) & C1_SPACE) != 0;
+    WORD CharType;
+
+    return GetStringTypeW(CT_CTYPE1, &wc, 1, &CharType) && (CharType & C1_SPACE);
 }
 
 /*************************************************************************
@@ -780,7 +718,9 @@
  */
 BOOL WINAPI IsCharBlankW(WCHAR wc)
 {
-    return (get_char_typeW(wc) & C1_BLANK) != 0;
+    WORD CharType;
+
+    return GetStringTypeW(CT_CTYPE1, &wc, 1, &CharType) && (CharType & C1_BLANK);
 }
 
 /*************************************************************************
@@ -797,7 +737,9 @@
  */
 BOOL WINAPI IsCharPunctW(WCHAR wc)
 {
-    return (get_char_typeW(wc) & C1_PUNCT) != 0;
+    WORD CharType;
+
+    return GetStringTypeW(CT_CTYPE1, &wc, 1, &CharType) && (CharType & C1_PUNCT);
 }
 
 /*************************************************************************
@@ -814,7 +756,9 @@
  */
 BOOL WINAPI IsCharCntrlW(WCHAR wc)
 {
-    return (get_char_typeW(wc) & C1_CNTRL) != 0;
+    WORD CharType;
+
+    return GetStringTypeW(CT_CTYPE1, &wc, 1, &CharType) && (CharType & C1_CNTRL);
 }
 
 /*************************************************************************
@@ -831,7 +775,9 @@
  */
 BOOL WINAPI IsCharDigitW(WCHAR wc)
 {
-    return (get_char_typeW(wc) & C1_DIGIT) != 0;
+    WORD CharType;
+
+    return GetStringTypeW(CT_CTYPE1, &wc, 1, &CharType) && (CharType & C1_DIGIT);
 }
 
 /*************************************************************************
@@ -848,7 +794,9 @@
  */
 BOOL WINAPI IsCharXDigitW(WCHAR wc)
 {
-    return (get_char_typeW(wc) & C1_XDIGIT) != 0;
+    WORD CharType;
+
+    return GetStringTypeW(CT_CTYPE1, &wc, 1, &CharType) && (CharType & C1_XDIGIT);
 }
 
 /*************************************************************************
Index: dlls/shlwapi/shlwapi.spec
===================================================================
RCS file: /home/wine/wine/dlls/shlwapi/shlwapi.spec,v
retrieving revision 1.98
diff -u -r1.98 shlwapi.spec
--- dlls/shlwapi/shlwapi.spec	3 Feb 2005 13:34:05 -0000	1.98
+++ dlls/shlwapi/shlwapi.spec	16 Feb 2005 01:32:37 -0000
@@ -22,10 +22,10 @@
 22  stdcall -noname SHFindDataBlock(ptr long)
 23  stdcall -noname SHStringFromGUIDA(ptr ptr long)
 24  stdcall -noname SHStringFromGUIDW(ptr ptr long)
-25  stdcall -noname IsCharAlphaWrapW(long)
-26  stdcall -noname IsCharUpperWrapW(long)
-27  stdcall -noname IsCharLowerWrapW(long)
-28  stdcall -noname IsCharAlphaNumericWrapW(long)
+25  stdcall -noname IsCharAlphaWrapW(long) user32.IsCharAlphaW
+26  stdcall -noname IsCharUpperWrapW(long) user32.IsCharUpperW
+27  stdcall -noname IsCharLowerWrapW(long) user32.IsCharLowerW
+28  stdcall -noname IsCharAlphaNumericWrapW(long) user32.IsCharAlphaNumericW
 29  stdcall -noname IsCharSpaceW(long)
 30  stdcall -noname IsCharBlankW(long)
 31  stdcall -noname IsCharPunctW(long)
Index: include/config.h.in
===================================================================
RCS file: /home/wine/wine/include/config.h.in,v
retrieving revision 1.213
diff -u -r1.213 config.h.in
--- include/config.h.in	10 Jan 2005 13:26:33 -0000	1.213
+++ include/config.h.in	16 Feb 2005 01:28:59 -0000
@@ -746,6 +746,9 @@
 /* Define to 1 if you have the `vsnprintf' function. */
 #undef HAVE_VSNPRINTF
 
+/* Define to 1 if you have the `strtoul' function. */
+#undef HAVE_STRTOUL
+
 /* Define to 1 if you have the `wait4' function. */
 #undef HAVE_WAIT4
 
Index: include/wine/port.h
===================================================================
RCS file: /home/wine/wine/include/wine/port.h,v
retrieving revision 1.64
diff -u -r1.64 port.h
--- include/wine/port.h	11 Jan 2005 10:46:58 -0000	1.64
+++ include/wine/port.h	16 Feb 2005 01:29:09 -0000
@@ -119,6 +119,11 @@
 
 #if !defined(HAVE_VSNPRINTF) && defined(HAVE__VSNPRINTF)
 #define vsnprintf _vsnprintf
+#define vsnprintfW vsnwprintf
+#endif
+
+#if !defined(HAVE_STRTOUL)
+#define strtoulW wcstoul
 #endif
 
 #ifndef S_ISLNK


More information about the wine-patches mailing list