Author: fireball Date: Fri Jan 22 11:49:40 2010 New Revision: 45199
URL: http://svn.reactos.org/svn/reactos?rev=45199&view=rev Log: - Best way to fix CRT problem: Add more underscores! (and hacks) - winex11.drv builds again. - Mark usleep as unimplemented.
Modified: branches/arwinss/reactos/dll/win32/winex11.drv/rosglue.c branches/arwinss/reactos/dll/win32/winex11.drv/window.c branches/arwinss/reactos/dll/win32/winex11.drv/xfont.c
Modified: branches/arwinss/reactos/dll/win32/winex11.drv/rosglue.c URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winex1... ============================================================================== --- branches/arwinss/reactos/dll/win32/winex11.drv/rosglue.c [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/winex11.drv/rosglue.c [iso-8859-1] Fri Jan 22 11:49:40 2010 @@ -4,6 +4,9 @@ #include <stdarg.h> #include <stdio.h> #include <stdlib.h> +#include <fcntl.h> +#include <share.h> +#include <io.h>
#include "windef.h" #include "winbase.h" @@ -17,12 +20,9 @@ int usleep (unsigned int useconds) { //return _usleep(useconds); + UNIMPLEMENTED; return 0; } - -//void xinerama_init( unsigned int width, unsigned int height ) -//{ -//}
WCHAR *wine_get_dos_file_name(char *path) { @@ -74,9 +74,55 @@ { }
+ +/* CRT compatibility HACKS */ + struct _stat; int CDECL fstat(int fd, struct _stat* buf) { int CDECL _fstat(int fd, struct _stat* buf); return _fstat(fd, buf); } + +char *__cdecl strdup(const char *_Src) +{ + return _strdup(_Src); +} + +int __cdecl open(const char *path,int flags,...) +{ + va_list ap; + + if (flags & O_CREAT) + { + int pmode; + va_start(ap, flags); + pmode = va_arg(ap, int); + va_end(ap); + return _sopen( path, flags, _SH_DENYNO, pmode ); + } + else + return _sopen( path, flags, _SH_DENYNO); +} + +int __cdecl close(int _FileHandle) +{ + return _close(_FileHandle); +} + +int __cdecl read(int _FileHandle,void *_DstBuf,unsigned int _MaxCharCount) +{ + return _read(_FileHandle, _DstBuf, _MaxCharCount); +} + +int __cdecl unlink(const char *_Filename) +{ + return _unlink(_Filename); +} + +int __cdecl access(const char *_Filename,int _AccessMode) +{ + return _access(_Filename, _AccessMode); +} + +
Modified: branches/arwinss/reactos/dll/win32/winex11.drv/window.c URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winex1... ============================================================================== --- branches/arwinss/reactos/dll/win32/winex11.drv/window.c [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/winex11.drv/window.c [iso-8859-1] Fri Jan 22 11:49:40 2010 @@ -946,7 +946,7 @@ /* set the WM_CLIENT_MACHINE and WM_LOCALE_NAME properties */ XSetWMProperties(display, data->whole_window, NULL, NULL, NULL, 0, NULL, NULL, NULL); /* set the pid. together, these properties are needed so the window manager can kill us if we freeze */ - i = getpid(); + i = _getpid(); XChangeProperty(display, data->whole_window, x11drv_atom(_NET_WM_PID), XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&i, 1);
Modified: branches/arwinss/reactos/dll/win32/winex11.drv/xfont.c URL: http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/winex1... ============================================================================== --- branches/arwinss/reactos/dll/win32/winex11.drv/xfont.c [iso-8859-1] (original) +++ branches/arwinss/reactos/dll/win32/winex11.drv/xfont.c [iso-8859-1] Fri Jan 22 11:49:40 2010 @@ -47,6 +47,16 @@ #include "wine/library.h" #include "wine/unicode.h" #include "wine/debug.h" + +#ifdef __REACTOS__ +// CRT compat HACKS +#define open _open +#define close _close +#define read _read +#define write _write +#define lseek _lseek +#define hypot _hypot +#endif
WINE_DEFAULT_DEBUG_CHANNEL(font);