[PATCH] RFC: C99: rewrote some extern inline to static inline

Yann Droneaud yann at droneaud.fr
Thu Apr 15 04:56:32 CDT 2010


In order to build with CLANG with default arguments, extern inline declaration
must be changed.

By default CLANG uses C99's "extern inline" semantic which is like
gcc's "inline", and not the expected gcc's "extern inline" behavor.

Additionnaly LLVM/CLANG don't support multiple function definitions with
different linkage in the same module (source file) : so it's not
possible to have a static inline definition in a header included in a
source file with a externally visible function of the same name.

This patch convert extern inline to static inline, so 
embedded functions are not globally visible.

This could be a problem if those symbols are needed. But currently,
I'm not able to give you any status: i was only able to run "cmd.exe",
before going further with LLVM/CLANG. I'm fighting with LLVM/CLANG bug instead.

If they are so symbols needed or if the binaries size grow to much,
the "extern inline" attribute will have to be converted to a macro,
expanded to "extern inline" with gcc in default behavor, and "inline" with
a C99 compatible compiler.

See for example how this work in GMP:
http://gmplib.org:8000/gmp/file/da5903b6e386/gmp-h.in#l414

---
 dlls/kernel32/heap.c   |    2 +
 include/winbase.h      |   61 ++++++++++++++++++++++-------------------------
 include/wine/library.h |   15 ++++--------
 include/wine/port.h    |   19 ++++----------
 include/wine/unicode.h |   33 +-------------------------
 include/winnt.h        |    7 ++---
 6 files changed, 46 insertions(+), 91 deletions(-)

diff --git a/dlls/kernel32/heap.c b/dlls/kernel32/heap.c
index ead0778..129755b 100644
--- a/dlls/kernel32/heap.c
+++ b/dlls/kernel32/heap.c
@@ -20,6 +20,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#define WINE_NO_INLINE_HEAP
+
 #include "config.h"
 #include "wine/port.h"
 
diff --git a/include/winbase.h b/include/winbase.h
index f5578c4..791b4f2 100644
--- a/include/winbase.h
+++ b/include/winbase.h
@@ -2194,12 +2194,15 @@ WINBASEAPI DWORD       WINAPI WriteTapemark(HANDLE,DWORD,DWORD,BOOL);
 #define                       Yield()
 WINBASEAPI BOOL        WINAPI ZombifyActCtx(HANDLE);
 
-WINBASEAPI LPSTR       WINAPI lstrcatA(LPSTR,LPCSTR);
-WINBASEAPI LPWSTR      WINAPI lstrcatW(LPWSTR,LPCWSTR);
 WINBASEAPI INT         WINAPI lstrcmpA(LPCSTR,LPCSTR);
 WINBASEAPI INT         WINAPI lstrcmpW(LPCWSTR,LPCWSTR);
 WINBASEAPI INT         WINAPI lstrcmpiA(LPCSTR,LPCSTR);
 WINBASEAPI INT         WINAPI lstrcmpiW(LPCWSTR,LPCWSTR);
+
+#if !defined(__WINESRC__) || defined(WINE_NO_INLINE_STRING)
+
+WINBASEAPI LPSTR       WINAPI lstrcatA(LPSTR,LPCSTR);
+WINBASEAPI LPWSTR      WINAPI lstrcatW(LPWSTR,LPCWSTR);
 WINBASEAPI LPSTR       WINAPI lstrcpyA(LPSTR,LPCSTR);
 WINBASEAPI LPWSTR      WINAPI lstrcpyW(LPWSTR,LPCWSTR);
 WINBASEAPI LPSTR       WINAPI lstrcpynA(LPSTR,LPCSTR,INT);
@@ -2207,11 +2210,11 @@ WINBASEAPI LPWSTR      WINAPI lstrcpynW(LPWSTR,LPCWSTR,INT);
 WINBASEAPI INT         WINAPI lstrlenA(LPCSTR);
 WINBASEAPI INT         WINAPI lstrlenW(LPCWSTR);
 
-#if !defined(WINE_NO_INLINE_STRING) && defined(__WINESRC__)
+#else
 
 /* string functions without the exception handler */
 
-extern inline LPWSTR WINAPI lstrcpynW( LPWSTR dst, LPCWSTR src, INT n )
+static inline LPWSTR WINAPI lstrcpynW( LPWSTR dst, LPCWSTR src, INT n )
 {
     LPWSTR d = dst;
     LPCWSTR s = src;
@@ -2226,7 +2229,7 @@ extern inline LPWSTR WINAPI lstrcpynW( LPWSTR dst, LPCWSTR src, INT n )
     return dst;
 }
 
-extern inline LPSTR WINAPI lstrcpynA( LPSTR dst, LPCSTR src, INT n )
+static inline LPSTR WINAPI lstrcpynA( LPSTR dst, LPCSTR src, INT n )
 {
     LPSTR d = dst;
     LPCSTR s = src;
@@ -2241,31 +2244,31 @@ extern inline LPSTR WINAPI lstrcpynA( LPSTR dst, LPCSTR src, INT n )
     return dst;
 }
 
-extern inline INT WINAPI lstrlenW( LPCWSTR str )
+static inline INT WINAPI lstrlenW( LPCWSTR str )
 {
     const WCHAR *s = str;
     while (*s) s++;
     return s - str;
 }
 
-extern inline INT WINAPI lstrlenA( LPCSTR str )
+static inline INT WINAPI lstrlenA( LPCSTR str )
 {
     return strlen( str );
 }
 
-extern inline LPWSTR WINAPI lstrcpyW( LPWSTR dst, LPCWSTR src )
+static inline LPWSTR WINAPI lstrcpyW( LPWSTR dst, LPCWSTR src )
 {
     WCHAR *p = dst;
     while ((*p++ = *src++));
     return dst;
 }
 
-extern inline LPSTR WINAPI lstrcpyA( LPSTR dst, LPCSTR src )
+static inline LPSTR WINAPI lstrcpyA( LPSTR dst, LPCSTR src )
 {
     return strcpy( dst, src );
 }
 
-extern inline LPWSTR WINAPI lstrcatW( LPWSTR dst, LPCWSTR src )
+static inline LPWSTR WINAPI lstrcatW( LPWSTR dst, LPCWSTR src )
 {
     WCHAR *p = dst;
     while (*p) p++;
@@ -2273,7 +2276,7 @@ extern inline LPWSTR WINAPI lstrcatW( LPWSTR dst, LPCWSTR src )
     return dst;
 }
 
-extern inline LPSTR WINAPI lstrcatA( LPSTR dst, LPCSTR src )
+static inline LPSTR WINAPI lstrcatA( LPSTR dst, LPCSTR src )
 {
     return strcat( dst, src );
 }
@@ -2282,7 +2285,7 @@ extern inline LPSTR WINAPI lstrcatA( LPSTR dst, LPCSTR src )
 #undef strncpy
 #define strncpy(d,s,n) error do_not_use_strncpy_use_lstrcpynA_or_memcpy_instead
 
-#endif /* !defined(WINE_NO_INLINE_STRING) && defined(__WINESRC__) */
+#endif /* !defined(__WINESRC__) || defined(WINE_NO_INLINE_STRING) */
 
 #define     lstrcat WINELIB_NAME_AW(lstrcat)
 #define     lstrcmp WINELIB_NAME_AW(lstrcmp)
@@ -2317,8 +2320,7 @@ extern WCHAR * CDECL wine_get_dos_file_name( LPCSTR str );
 #ifdef __i386__
 # if defined(__GNUC__) && !defined(_NTSYSTEM_)
 
-extern inline LONG WINAPI InterlockedCompareExchange( LONG volatile *dest, LONG xchg, LONG compare );
-extern inline LONG WINAPI InterlockedCompareExchange( LONG volatile *dest, LONG xchg, LONG compare )
+static inline LONG WINAPI InterlockedCompareExchange( LONG volatile *dest, LONG xchg, LONG compare )
 {
     LONG ret;
     __asm__ __volatile__( "lock; cmpxchgl %2,(%1)"
@@ -2326,8 +2328,7 @@ extern inline LONG WINAPI InterlockedCompareExchange( LONG volatile *dest, LONG
     return ret;
 }
 
-extern inline LONG WINAPI InterlockedExchange( LONG volatile *dest, LONG val );
-extern inline LONG WINAPI InterlockedExchange( LONG volatile *dest, LONG val )
+static inline LONG WINAPI InterlockedExchange( LONG volatile *dest, LONG val )
 {
     LONG ret;
     __asm__ __volatile__( "lock; xchgl %0,(%1)"
@@ -2335,8 +2336,7 @@ extern inline LONG WINAPI InterlockedExchange( LONG volatile *dest, LONG val )
     return ret;
 }
 
-extern inline LONG WINAPI InterlockedExchangeAdd( LONG volatile *dest, LONG incr );
-extern inline LONG WINAPI InterlockedExchangeAdd( LONG volatile *dest, LONG incr )
+static inline LONG WINAPI InterlockedExchangeAdd( LONG volatile *dest, LONG incr )
 {
     LONG ret;
     __asm__ __volatile__( "lock; xaddl %0,(%1)"
@@ -2344,14 +2344,12 @@ extern inline LONG WINAPI InterlockedExchangeAdd( LONG volatile *dest, LONG incr
     return ret;
 }
 
-extern inline LONG WINAPI InterlockedIncrement( LONG volatile *dest );
-extern inline LONG WINAPI InterlockedIncrement( LONG volatile *dest )
+static inline LONG WINAPI InterlockedIncrement( LONG volatile *dest )
 {
     return InterlockedExchangeAdd( dest, 1 ) + 1;
 }
 
-extern inline LONG WINAPI InterlockedDecrement( LONG volatile *dest );
-extern inline LONG WINAPI InterlockedDecrement( LONG volatile *dest )
+static inline LONG WINAPI InterlockedDecrement( LONG volatile *dest )
 {
     return InterlockedExchangeAdd( dest, -1 ) - 1;
 }
@@ -2474,8 +2472,7 @@ static inline LONG WINAPI InterlockedDecrement( LONG volatile *dest )
 
 #if defined(__GNUC__) && !defined(__MINGW32__) && (defined(__i386__) || defined(__x86_64__))
 
-extern inline DWORD WINAPI GetLastError(void);
-extern inline DWORD WINAPI GetLastError(void)
+static inline DWORD WINAPI GetLastError(void)
 {
     DWORD ret;
 #ifdef __x86_64__
@@ -2486,8 +2483,7 @@ extern inline DWORD WINAPI GetLastError(void)
     return ret;
 }
 
-extern inline DWORD WINAPI GetCurrentProcessId(void);
-extern inline DWORD WINAPI GetCurrentProcessId(void)
+static inline DWORD WINAPI GetCurrentProcessId(void)
 {
     DWORD ret;
 #ifdef __x86_64__
@@ -2498,8 +2494,7 @@ extern inline DWORD WINAPI GetCurrentProcessId(void)
     return ret;
 }
 
-extern inline DWORD WINAPI GetCurrentThreadId(void);
-extern inline DWORD WINAPI GetCurrentThreadId(void)
+static inline DWORD WINAPI GetCurrentThreadId(void)
 {
     DWORD ret;
 #ifdef __x86_64__
@@ -2510,8 +2505,7 @@ extern inline DWORD WINAPI GetCurrentThreadId(void)
     return ret;
 }
 
-extern inline void WINAPI SetLastError( DWORD err );
-extern inline void WINAPI SetLastError( DWORD err )
+static inline void WINAPI SetLastError( DWORD err )
 {
 #ifdef __x86_64__
     __asm__ __volatile__( ".byte 0x65\n\tmovl %0,0x68" : : "r" (err) : "memory" );
@@ -2520,8 +2514,8 @@ extern inline void WINAPI SetLastError( DWORD err )
 #endif
 }
 
-extern inline HANDLE WINAPI GetProcessHeap(void);
-extern inline HANDLE WINAPI GetProcessHeap(void)
+#if defined(__WINESRC__) && !defined(WINE_NO_INLINE_HEAP)
+static inline HANDLE WINAPI GetProcessHeap(void)
 {
     HANDLE *pdb;
 #ifdef __x86_64__
@@ -2532,6 +2526,9 @@ extern inline HANDLE WINAPI GetProcessHeap(void)
     return pdb[0x18 / sizeof(HANDLE)];  /* get dword at offset 0x18 in pdb */
 #endif
 }
+#else
+WINBASEAPI HANDLE      WINAPI GetProcessHeap(void);
+#endif
 
 #else  /* __GNUC__ */
 
diff --git a/include/wine/library.h b/include/wine/library.h
index 8eedf04..0ee402e 100644
--- a/include/wine/library.h
+++ b/include/wine/library.h
@@ -163,28 +163,22 @@ static inline int wine_ldt_is_empty( const LDT_ENTRY *ent )
 
 # ifdef __MINGW32__
 #  define __DEFINE_GET_SEG(seg) \
-    static inline unsigned short wine_get_##seg(void); \
     static inline unsigned short wine_get_##seg(void) \
     { unsigned short res; __asm__ __volatile__("movw %%" #seg ",%w0" : "=r"(res)); return res; }
 #  define __DEFINE_SET_SEG(seg) \
-    static inline void wine_set_##seg(int val); \
     static inline void wine_set_##seg(int val) { __asm__("movw %w0,%%" #seg : : "r" (val)); }
 # elif defined(__GNUC__)
 #  define __DEFINE_GET_SEG(seg) \
-    extern inline unsigned short wine_get_##seg(void); \
-    extern inline unsigned short wine_get_##seg(void) \
+    static inline unsigned short wine_get_##seg(void) \
     { unsigned short res; __asm__ __volatile__("movw %%" #seg ",%w0" : "=r"(res)); return res; }
 #  define __DEFINE_SET_SEG(seg) \
-    extern inline void wine_set_##seg(int val); \
-    extern inline void wine_set_##seg(int val) { __asm__("movw %w0,%%" #seg : : "r" (val)); }
+    static inline void wine_set_##seg(int val) { __asm__("movw %w0,%%" #seg : : "r" (val)); }
 # elif defined(_MSC_VER)
 #  define __DEFINE_GET_SEG(seg) \
-    extern inline unsigned short wine_get_##seg(void); \
-    extern inline unsigned short wine_get_##seg(void) \
+    static inline unsigned short wine_get_##seg(void) \
     { unsigned short res; __asm { mov res, seg } return res; }
 #  define __DEFINE_SET_SEG(seg) \
-    extern inline void wine_set_##seg(unsigned short val); \
-    extern inline void wine_set_##seg(unsigned short val) { __asm { mov seg, val } }
+    static inline void wine_set_##seg(unsigned short val) { __asm { mov seg, val } }
 # else  /* __GNUC__ || _MSC_VER */
 #  define __DEFINE_GET_SEG(seg) extern unsigned short wine_get_##seg(void);
 #  define __DEFINE_SET_SEG(seg) extern void wine_set_##seg(unsigned int);
@@ -203,6 +197,7 @@ __DEFINE_SET_SEG(gs)
 
 #endif  /* __i386__ */
 
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/include/wine/port.h b/include/wine/port.h
index 61c8399..180a6d8 100644
--- a/include/wine/port.h
+++ b/include/wine/port.h
@@ -355,14 +355,9 @@ extern int spawnvp(int mode, const char *cmdname, const char * const argv[]);
 
 #if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
 
-extern inline int interlocked_cmpxchg( int *dest, int xchg, int compare );
-extern inline void *interlocked_cmpxchg_ptr( void **dest, void *xchg, void *compare );
 extern __int64 interlocked_cmpxchg64( __int64 *dest, __int64 xchg, __int64 compare );
-extern inline int interlocked_xchg( int *dest, int val );
-extern inline void *interlocked_xchg_ptr( void **dest, void *val );
-extern inline int interlocked_xchg_add( int *dest, int incr );
 
-extern inline int interlocked_cmpxchg( int *dest, int xchg, int compare )
+static inline int interlocked_cmpxchg( int *dest, int xchg, int compare )
 {
     int ret;
     __asm__ __volatile__( "lock; cmpxchgl %2,(%1)"
@@ -370,7 +365,7 @@ extern inline int interlocked_cmpxchg( int *dest, int xchg, int compare )
     return ret;
 }
 
-extern inline void *interlocked_cmpxchg_ptr( void **dest, void *xchg, void *compare )
+static inline void *interlocked_cmpxchg_ptr( void **dest, void *xchg, void *compare )
 {
     void *ret;
 #ifdef __x86_64__
@@ -383,7 +378,7 @@ extern inline void *interlocked_cmpxchg_ptr( void **dest, void *xchg, void *comp
     return ret;
 }
 
-extern inline int interlocked_xchg( int *dest, int val )
+static inline int interlocked_xchg( int *dest, int val )
 {
     int ret;
     __asm__ __volatile__( "lock; xchgl %0,(%1)"
@@ -391,7 +386,7 @@ extern inline int interlocked_xchg( int *dest, int val )
     return ret;
 }
 
-extern inline void *interlocked_xchg_ptr( void **dest, void *val )
+static inline void *interlocked_xchg_ptr( void **dest, void *val )
 {
     void *ret;
 #ifdef __x86_64__
@@ -404,7 +399,7 @@ extern inline void *interlocked_xchg_ptr( void **dest, void *val )
     return ret;
 }
 
-extern inline int interlocked_xchg_add( int *dest, int incr )
+static inline int interlocked_xchg_add( int *dest, int incr )
 {
     int ret;
     __asm__ __volatile__( "lock; xaddl %0,(%1)"
@@ -413,9 +408,7 @@ extern inline int interlocked_xchg_add( int *dest, int incr )
 }
 
 #ifdef __x86_64__
-extern inline unsigned char interlocked_cmpxchg128( __int64 *dest, __int64 xchg_high,
-                                                    __int64 xchg_low, __int64 *compare );
-extern inline unsigned char interlocked_cmpxchg128( __int64 *dest, __int64 xchg_high,
+static inline unsigned char interlocked_cmpxchg128( __int64 *dest, __int64 xchg_high,
                                                     __int64 xchg_low, __int64 *compare )
 {
     unsigned char ret;
diff --git a/include/wine/unicode.h b/include/wine/unicode.h
index 780665a..b685e43 100644
--- a/include/wine/unicode.h
+++ b/include/wine/unicode.h
@@ -44,7 +44,7 @@ extern "C" {
 #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 */
@@ -112,20 +112,17 @@ extern int snprintfW( WCHAR *str, size_t len, const WCHAR *format, ... );
 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[];
@@ -134,74 +131,62 @@ WINE_UNICODE_INLINE WCHAR toupperW( WCHAR ch )
 
 /* 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);
@@ -209,7 +194,6 @@ WINE_UNICODE_INLINE int isprintW( WCHAR wc )
 
 /* 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;
@@ -217,7 +201,6 @@ WINE_UNICODE_INLINE unsigned int strlenW( const WCHAR *str )
     return 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;
@@ -228,14 +211,12 @@ WINE_UNICODE_INLINE WCHAR *strcpyW( WCHAR *dst, const WCHAR *src )
 /* 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;
@@ -243,21 +224,18 @@ WINE_UNICODE_INLINE int strncmpW( const WCHAR *str1, const WCHAR *str2, int n )
     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;
@@ -265,14 +243,12 @@ WINE_UNICODE_INLINE WCHAR *strrchrW( const WCHAR *str, WCHAR ch )
     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;
@@ -280,7 +256,6 @@ WINE_UNICODE_INLINE size_t strspnW( const WCHAR *str, const WCHAR *accept )
     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;
@@ -288,7 +263,6 @@ WINE_UNICODE_INLINE size_t strcspnW( const WCHAR *str, const WCHAR *reject )
     return ptr - str;
 }
 
-WINE_UNICODE_INLINE WCHAR *strlwrW( WCHAR *str );
 WINE_UNICODE_INLINE WCHAR *strlwrW( WCHAR *str )
 {
     WCHAR *ret = str;
@@ -296,7 +270,6 @@ WINE_UNICODE_INLINE WCHAR *strlwrW( WCHAR *str )
     return ret;
 }
 
-WINE_UNICODE_INLINE WCHAR *struprW( WCHAR *str );
 WINE_UNICODE_INLINE WCHAR *struprW( WCHAR *str )
 {
     WCHAR *ret = str;
@@ -304,7 +277,6 @@ WINE_UNICODE_INLINE WCHAR *struprW( WCHAR *str )
     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;
@@ -312,7 +284,6 @@ WINE_UNICODE_INLINE WCHAR *memchrW( const WCHAR *ptr, WCHAR ch, size_t n )
     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;
@@ -321,13 +292,11 @@ WINE_UNICODE_INLINE WCHAR *memrchrW( const WCHAR *ptr, WCHAR ch, size_t n )
     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 );
diff --git a/include/winnt.h b/include/winnt.h
index d4a158e..947dcd7 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -2467,15 +2467,14 @@ typedef struct _NT_TIB
 struct _TEB;
 
 #if defined(__i386__) && defined(__GNUC__)
-extern inline struct _TEB * WINAPI NtCurrentTeb(void);
-extern inline struct _TEB * WINAPI NtCurrentTeb(void)
+static inline struct _TEB * WINAPI NtCurrentTeb(void)
 {
     struct _TEB *teb;
     __asm__(".byte 0x64\n\tmovl (0x18),%0" : "=r" (teb));
     return teb;
 }
 #elif defined(__i386__) && defined(_MSC_VER)
-extern inline struct _TEB * WINAPI NtCurrentTeb(void)
+static inline struct _TEB * WINAPI NtCurrentTeb(void)
 {
   struct _TEB *teb;
   __asm mov eax, fs:[0x18];
@@ -2490,7 +2489,7 @@ static inline struct _TEB * WINAPI NtCurrentTeb(void)
     return teb;
 }
 #elif defined(__x86_64__) && defined (_MSC_VER)
-extern inline struct _TEB * WINAPI NtCurrentTeb(void)
+static inline struct _TEB * WINAPI NtCurrentTeb(void)
 {
   struct _TEB *teb;
   __asm mov rax, gs:[0x30];
-- 
1.6.2.5




More information about the wine-patches mailing list