Commit 3b2019ba authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

Make lstr* functions inline inside Wine.

parent 0d735ac9
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <stdarg.h> #include <stdarg.h>
#include <string.h> #include <string.h>
#define WINE_NO_INLINE_STRING
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "excpt.h" #include "excpt.h"
......
...@@ -252,13 +252,13 @@ ...@@ -252,13 +252,13 @@
306 stdcall StrCmpNIA(str str long) shlwapi.StrCmpNIA 306 stdcall StrCmpNIA(str str long) shlwapi.StrCmpNIA
307 stdcall StrCmpNIW(wstr wstr long) shlwapi.StrCmpNIW 307 stdcall StrCmpNIW(wstr wstr long) shlwapi.StrCmpNIW
308 stdcall StrCmpNW(wstr wstr long) shlwapi.StrCmpNW 308 stdcall StrCmpNW(wstr wstr long) shlwapi.StrCmpNW
309 stdcall StrCpyNA (ptr str long) lstrcpynA 309 stdcall StrCpyNA (ptr str long) kernel32.lstrcpynA
310 stdcall StrCpyNW(wstr wstr long) shlwapi.StrCpyNW 310 stdcall StrCpyNW(wstr wstr long) shlwapi.StrCpyNW
311 stdcall StrNCmpA(str str long) shlwapi.StrCmpNA 311 stdcall StrNCmpA(str str long) shlwapi.StrCmpNA
312 stdcall StrNCmpIA(str str long) shlwapi.StrCmpNIA 312 stdcall StrNCmpIA(str str long) shlwapi.StrCmpNIA
313 stdcall StrNCmpIW(wstr wstr long) shlwapi.StrCmpNIW 313 stdcall StrNCmpIW(wstr wstr long) shlwapi.StrCmpNIW
314 stdcall StrNCmpW(wstr wstr long) shlwapi.StrCmpNW 314 stdcall StrNCmpW(wstr wstr long) shlwapi.StrCmpNW
315 stdcall StrNCpyA (ptr str long) lstrcpynA 315 stdcall StrNCpyA (ptr str long) kernel32.lstrcpynA
316 stdcall StrNCpyW(wstr wstr long) shlwapi.StrCpyNW 316 stdcall StrNCpyW(wstr wstr long) shlwapi.StrCpyNW
317 stdcall StrRChrA(str str long) shlwapi.StrRChrA 317 stdcall StrRChrA(str str long) shlwapi.StrRChrA
318 stdcall StrRChrIA(str str long) shlwapi.StrRChrIA 318 stdcall StrRChrIA(str str long) shlwapi.StrRChrIA
......
...@@ -1966,18 +1966,96 @@ BOOL WINAPI WriteProfileStringA(LPCSTR,LPCSTR,LPCSTR); ...@@ -1966,18 +1966,96 @@ BOOL WINAPI WriteProfileStringA(LPCSTR,LPCSTR,LPCSTR);
BOOL WINAPI WriteProfileStringW(LPCWSTR,LPCWSTR,LPCWSTR); BOOL WINAPI WriteProfileStringW(LPCWSTR,LPCWSTR,LPCWSTR);
#define WriteProfileString WINELIB_NAME_AW(WriteProfileString) #define WriteProfileString WINELIB_NAME_AW(WriteProfileString)
#define Yield() #define Yield()
#if defined(WINE_NO_INLINE_STRING) || !defined(__WINESRC__)
LPSTR WINAPI lstrcatA(LPSTR,LPCSTR); LPSTR WINAPI lstrcatA(LPSTR,LPCSTR);
LPWSTR WINAPI lstrcatW(LPWSTR,LPCWSTR); LPWSTR WINAPI lstrcatW(LPWSTR,LPCWSTR);
#define lstrcat WINELIB_NAME_AW(lstrcat)
LPSTR WINAPI lstrcpyA(LPSTR,LPCSTR); LPSTR WINAPI lstrcpyA(LPSTR,LPCSTR);
LPWSTR WINAPI lstrcpyW(LPWSTR,LPCWSTR); LPWSTR WINAPI lstrcpyW(LPWSTR,LPCWSTR);
#define lstrcpy WINELIB_NAME_AW(lstrcpy)
LPSTR WINAPI lstrcpynA(LPSTR,LPCSTR,INT); LPSTR WINAPI lstrcpynA(LPSTR,LPCSTR,INT);
LPWSTR WINAPI lstrcpynW(LPWSTR,LPCWSTR,INT); LPWSTR WINAPI lstrcpynW(LPWSTR,LPCWSTR,INT);
#define lstrcpyn WINELIB_NAME_AW(lstrcpyn)
INT WINAPI lstrlenA(LPCSTR); INT WINAPI lstrlenA(LPCSTR);
INT WINAPI lstrlenW(LPCWSTR); INT WINAPI lstrlenW(LPCWSTR);
#else /* !defined(WINE_NO_INLINE_STRING) && defined(__WINESRC__) */
/* string functions without the exception handler */
extern inline LPWSTR lstrcpynW( LPWSTR dst, LPCWSTR src, INT n )
{
LPWSTR d = dst;
LPCWSTR s = src;
UINT count = n;
while ((count > 1) && *s)
{
count--;
*d++ = *s++;
}
if (count) *d = 0;
return dst;
}
extern inline LPSTR lstrcpynA( LPSTR dst, LPCSTR src, INT n )
{
LPSTR d = dst;
LPCSTR s = src;
UINT count = n;
while ((count > 1) && *s)
{
count--;
*d++ = *s++;
}
if (count) *d = 0;
return dst;
}
extern inline INT lstrlenW( LPCWSTR str )
{
const WCHAR *s = str;
while (*s) s++;
return s - str;
}
extern inline INT lstrlenA( LPCSTR str )
{
return strlen( str );
}
extern inline LPWSTR lstrcpyW( LPWSTR dst, LPCWSTR src )
{
WCHAR *p = dst;
while ((*p++ = *src++));
return dst;
}
extern inline LPSTR lstrcpyA( LPSTR dst, LPCSTR src )
{
return strcpy( dst, src );
}
extern inline LPWSTR lstrcatW( LPWSTR dst, LPCWSTR src )
{
WCHAR *p = dst;
while (*p) p++;
while ((*p++ = *src++));
return dst;
}
extern inline LPSTR lstrcatA( LPSTR dst, LPCSTR src )
{
return strcat( dst, src );
}
#endif /* !defined(WINE_NO_INLINE_STRING) && defined(__WINESRC__) */
#define lstrcat WINELIB_NAME_AW(lstrcat)
#define lstrcpy WINELIB_NAME_AW(lstrcpy)
#define lstrcpyn WINELIB_NAME_AW(lstrcpyn)
#define lstrlen WINELIB_NAME_AW(lstrlen) #define lstrlen WINELIB_NAME_AW(lstrlen)
LONG WINAPI _hread(HFILE,LPVOID,LONG); LONG WINAPI _hread(HFILE,LPVOID,LONG);
LONG WINAPI _hwrite(HFILE,LPCSTR,LONG); LONG WINAPI _hwrite(HFILE,LPCSTR,LONG);
HFILE WINAPI _lcreat(LPCSTR,INT); HFILE WINAPI _lcreat(LPCSTR,INT);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment