Author: tkreuzer
Date: Thu Jan 27 12:12:15 2011
New Revision: 50511
URL: 
http://svn.reactos.org/svn/reactos?rev=50511&view=rev
Log:
[UNICODE]
revert change to string.c from r49492 and apply the fix to wine/unicode.h. also move the
include of string.h to unicode.h
sync unicode.h with wine
Modified:
    branches/cmake-bringup/tools/unicode/string.c
    branches/cmake-bringup/tools/unicode/wine/unicode.h
Modified: branches/cmake-bringup/tools/unicode/string.c
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/tools/unicode/str…
==============================================================================
--- branches/cmake-bringup/tools/unicode/string.c [iso-8859-1] (original)
+++ branches/cmake-bringup/tools/unicode/string.c [iso-8859-1] Thu Jan 27 12:12:15 2011
@@ -21,11 +21,8 @@
 #include <assert.h>
 #include <limits.h>
 #include <stdio.h>
-#include <string.h>
-
-#ifndef _MSC_VER
-  #define WINE_UNICODE_INLINE  /* nothing */
-#endif
+
+#define WINE_UNICODE_INLINE  /* nothing */
 #include "wine/unicode.h"
 int strcmpiW( const WCHAR *str1, const WCHAR *str2 )
@@ -467,7 +464,7 @@
                     *fmta = '\0';
                     if (*iter == 'a' || *iter == 'A' ||
                         *iter == 'e' || *iter == 'E' ||
-                        *iter == 'f' || *iter == 'F' ||
+                        *iter == 'f' || *iter == 'F' ||
                         *iter == 'g' || *iter == 'G')
                         sprintf(bufaiter, fmtbufa, va_arg(valist, double));
                     else
Modified: branches/cmake-bringup/tools/unicode/wine/unicode.h
URL:
http://svn.reactos.org/svn/reactos/branches/cmake-bringup/tools/unicode/win…
==============================================================================
--- branches/cmake-bringup/tools/unicode/wine/unicode.h [iso-8859-1] (original)
+++ branches/cmake-bringup/tools/unicode/wine/unicode.h [iso-8859-1] Thu Jan 27 12:12:15
2011
@@ -18,10 +18,11 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
-#ifndef __WINE_UNICODE_H
-#define __WINE_UNICODE_H
+#ifndef __WINE_WINE_UNICODE_H
+#define __WINE_WINE_UNICODE_H
 #include <stdarg.h>
+#include <string.h>
 #include <host/typedefs.h>
 // Definitions copied from <winnls.h>
@@ -44,12 +45,24 @@
 #define WC_NO_BEST_FIT_CHARS 1024
 #define WC_ERR_INVALID_CHARS 0x0080
+#ifdef __WINE_WINE_TEST_H
+#error This file should not be used in Wine tests
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #ifndef WINE_UNICODE_API
-#define WINE_UNICODE_API DECLSPEC_IMPORT
+# if defined(_MSC_VER) || defined(__MINGW32__)
+#  define WINE_UNICODE_API DECLSPEC_IMPORT
+# else
+#  define WINE_UNICODE_API
+# endif
 #endif
 #ifndef WINE_UNICODE_INLINE
-#define WINE_UNICODE_INLINE extern inline
+#define WINE_UNICODE_INLINE static inline
 #endif
 /* code page info common to SBCS and DBCS */
@@ -117,20 +130,17 @@
 extern int vsprintfW( WCHAR *str, const WCHAR *format, va_list valist );
 extern int vsnprintfW( WCHAR *str, size_t len, const WCHAR *format, va_list valist );
-WINE_UNICODE_INLINE int wine_is_dbcs_leadbyte( const union cptable *table, unsigned char
ch );
 WINE_UNICODE_INLINE int wine_is_dbcs_leadbyte( const union cptable *table, unsigned char
ch )
 {
     return (table->info.char_size == 2) &&
(table->dbcs.cp2uni_leadbytes[ch]);
 }
-WINE_UNICODE_INLINE WCHAR tolowerW( WCHAR ch );
 WINE_UNICODE_INLINE WCHAR tolowerW( WCHAR ch )
 {
     extern WINE_UNICODE_API const WCHAR wine_casemap_lower[];
     return ch + wine_casemap_lower[wine_casemap_lower[ch >> 8] + (ch & 0xff)];
 }
-WINE_UNICODE_INLINE WCHAR toupperW( WCHAR ch );
 WINE_UNICODE_INLINE WCHAR toupperW( WCHAR ch )
 {
     extern WINE_UNICODE_API const WCHAR wine_casemap_upper[];
@@ -139,74 +149,62 @@
 /* the character type contains the C1_* flags in the low 12 bits */
 /* and the C2_* type in the high 4 bits */
-WINE_UNICODE_INLINE unsigned short get_char_typeW( WCHAR ch );
 WINE_UNICODE_INLINE unsigned short get_char_typeW( WCHAR ch )
 {
     extern WINE_UNICODE_API const unsigned short wine_wctype_table[];
     return wine_wctype_table[wine_wctype_table[ch >> 8] + (ch & 0xff)];
 }
-WINE_UNICODE_INLINE int iscntrlW( WCHAR wc );
 WINE_UNICODE_INLINE int iscntrlW( WCHAR wc )
 {
     return get_char_typeW(wc) & C1_CNTRL;
 }
-WINE_UNICODE_INLINE int ispunctW( WCHAR wc );
 WINE_UNICODE_INLINE int ispunctW( WCHAR wc )
 {
     return get_char_typeW(wc) & C1_PUNCT;
 }
-WINE_UNICODE_INLINE int isspaceW( WCHAR wc );
 WINE_UNICODE_INLINE int isspaceW( WCHAR wc )
 {
     return get_char_typeW(wc) & C1_SPACE;
 }
-WINE_UNICODE_INLINE int isdigitW( WCHAR wc );
 WINE_UNICODE_INLINE int isdigitW( WCHAR wc )
 {
     return get_char_typeW(wc) & C1_DIGIT;
 }
-WINE_UNICODE_INLINE int isxdigitW( WCHAR wc );
 WINE_UNICODE_INLINE int isxdigitW( WCHAR wc )
 {
     return get_char_typeW(wc) & C1_XDIGIT;
 }
-WINE_UNICODE_INLINE int islowerW( WCHAR wc );
 WINE_UNICODE_INLINE int islowerW( WCHAR wc )
 {
     return get_char_typeW(wc) & C1_LOWER;
 }
-WINE_UNICODE_INLINE int isupperW( WCHAR wc );
 WINE_UNICODE_INLINE int isupperW( WCHAR wc )
 {
     return get_char_typeW(wc) & C1_UPPER;
 }
-WINE_UNICODE_INLINE int isalnumW( WCHAR wc );
 WINE_UNICODE_INLINE int isalnumW( WCHAR wc )
 {
     return get_char_typeW(wc) & (C1_ALPHA|C1_DIGIT|C1_LOWER|C1_UPPER);
 }
-WINE_UNICODE_INLINE int isalphaW( WCHAR wc );
 WINE_UNICODE_INLINE int isalphaW( WCHAR wc )
 {
     return get_char_typeW(wc) & (C1_ALPHA|C1_LOWER|C1_UPPER);
 }
-WINE_UNICODE_INLINE int isgraphW( WCHAR wc );
 WINE_UNICODE_INLINE int isgraphW( WCHAR wc )
 {
     return get_char_typeW(wc) & (C1_ALPHA|C1_PUNCT|C1_DIGIT|C1_LOWER|C1_UPPER);
 }
-WINE_UNICODE_INLINE int isprintW( WCHAR wc );
 WINE_UNICODE_INLINE int isprintW( WCHAR wc )
 {
     return get_char_typeW(wc) &
(C1_ALPHA|C1_BLANK|C1_PUNCT|C1_DIGIT|C1_LOWER|C1_UPPER);
@@ -214,7 +212,6 @@
 /* some useful string manipulation routines */
-WINE_UNICODE_INLINE unsigned int strlenW( const WCHAR *str );
 WINE_UNICODE_INLINE unsigned int strlenW( const WCHAR *str )
 {
     const WCHAR *s = str;
@@ -222,7 +219,6 @@
     return (unsigned int)(s - str);
 }
-WINE_UNICODE_INLINE WCHAR *strcpyW( WCHAR *dst, const WCHAR *src );
 WINE_UNICODE_INLINE WCHAR *strcpyW( WCHAR *dst, const WCHAR *src )
 {
     WCHAR *p = dst;
@@ -233,14 +229,12 @@
 /* strncpy doesn't do what you think, don't use it */
 #define strncpyW(d,s,n) error do_not_use_strncpyW_use_lstrcpynW_or_memcpy_instead
-WINE_UNICODE_INLINE int strcmpW( const WCHAR *str1, const WCHAR *str2 );
 WINE_UNICODE_INLINE int strcmpW( const WCHAR *str1, const WCHAR *str2 )
 {
     while (*str1 && (*str1 == *str2)) { str1++; str2++; }
     return *str1 - *str2;
 }
-WINE_UNICODE_INLINE int strncmpW( const WCHAR *str1, const WCHAR *str2, int n );
 WINE_UNICODE_INLINE int strncmpW( const WCHAR *str1, const WCHAR *str2, int n )
 {
     if (n <= 0) return 0;
@@ -248,21 +242,18 @@
     return *str1 - *str2;
 }
-WINE_UNICODE_INLINE WCHAR *strcatW( WCHAR *dst, const WCHAR *src );
 WINE_UNICODE_INLINE WCHAR *strcatW( WCHAR *dst, const WCHAR *src )
 {
     strcpyW( dst + strlenW(dst), src );
     return dst;
 }
-WINE_UNICODE_INLINE WCHAR *strchrW( const WCHAR *str, WCHAR ch );
 WINE_UNICODE_INLINE WCHAR *strchrW( const WCHAR *str, WCHAR ch )
 {
     do { if (*str == ch) return (WCHAR *)(ULONG_PTR)str; } while (*str++);
     return NULL;
 }
-WINE_UNICODE_INLINE WCHAR *strrchrW( const WCHAR *str, WCHAR ch );
 WINE_UNICODE_INLINE WCHAR *strrchrW( const WCHAR *str, WCHAR ch )
 {
     WCHAR *ret = NULL;
@@ -270,14 +261,12 @@
     return ret;
 }
-WINE_UNICODE_INLINE WCHAR *strpbrkW( const WCHAR *str, const WCHAR *accept );
 WINE_UNICODE_INLINE WCHAR *strpbrkW( const WCHAR *str, const WCHAR *accept )
 {
     for ( ; *str; str++) if (strchrW( accept, *str )) return (WCHAR *)(ULONG_PTR)str;
     return NULL;
 }
-WINE_UNICODE_INLINE size_t strspnW( const WCHAR *str, const WCHAR *accept );
 WINE_UNICODE_INLINE size_t strspnW( const WCHAR *str, const WCHAR *accept )
 {
     const WCHAR *ptr;
@@ -285,7 +274,6 @@
     return ptr - str;
 }
-WINE_UNICODE_INLINE size_t strcspnW( const WCHAR *str, const WCHAR *reject );
 WINE_UNICODE_INLINE size_t strcspnW( const WCHAR *str, const WCHAR *reject )
 {
     const WCHAR *ptr;
@@ -293,7 +281,6 @@
     return ptr - str;
 }
-WINE_UNICODE_INLINE WCHAR *strlwrW( WCHAR *str );
 WINE_UNICODE_INLINE WCHAR *strlwrW( WCHAR *str )
 {
     WCHAR *ret = str;
@@ -301,7 +288,6 @@
     return ret;
 }
-WINE_UNICODE_INLINE WCHAR *struprW( WCHAR *str );
 WINE_UNICODE_INLINE WCHAR *struprW( WCHAR *str )
 {
     WCHAR *ret = str;
@@ -309,7 +295,6 @@
     return ret;
 }
-WINE_UNICODE_INLINE WCHAR *memchrW( const WCHAR *ptr, WCHAR ch, size_t n );
 WINE_UNICODE_INLINE WCHAR *memchrW( const WCHAR *ptr, WCHAR ch, size_t n )
 {
     const WCHAR *end;
@@ -317,7 +302,6 @@
     return NULL;
 }
-WINE_UNICODE_INLINE WCHAR *memrchrW( const WCHAR *ptr, WCHAR ch, size_t n );
 WINE_UNICODE_INLINE WCHAR *memrchrW( const WCHAR *ptr, WCHAR ch, size_t n )
 {
     const WCHAR *end;
@@ -326,13 +310,11 @@
     return ret;
 }
-WINE_UNICODE_INLINE long int atolW( const WCHAR *str );
 WINE_UNICODE_INLINE long int atolW( const WCHAR *str )
 {
     return strtolW( str, (WCHAR **)0, 10 );
 }
-WINE_UNICODE_INLINE int atoiW( const WCHAR *str );
 WINE_UNICODE_INLINE int atoiW( const WCHAR *str )
 {
     return (int)atolW( str );
@@ -340,4 +322,8 @@
 #undef WINE_UNICODE_INLINE
-#endif  /* __WINE_UNICODE_H */
+#ifdef __cplusplus
+}
+#endif
+
+#endif  /* __WINE_WINE_UNICODE_H */