Commit ac81d02a authored by Rafael Kitover's avatar Rafael Kitover Committed by Alexandre Julliard

Portability fixes for Cygwin.

parent 7375597f
...@@ -536,6 +536,7 @@ HANDLE WINAPI CreateNamedPipeW( LPCWSTR name, DWORD dwOpenMode, ...@@ -536,6 +536,7 @@ HANDLE WINAPI CreateNamedPipeW( LPCWSTR name, DWORD dwOpenMode,
BOOL WINAPI PeekNamedPipe( HANDLE hPipe, LPVOID lpvBuffer, DWORD cbBuffer, BOOL WINAPI PeekNamedPipe( HANDLE hPipe, LPVOID lpvBuffer, DWORD cbBuffer,
LPDWORD lpcbRead, LPDWORD lpcbAvail, LPDWORD lpcbMessage ) LPDWORD lpcbRead, LPDWORD lpcbAvail, LPDWORD lpcbMessage )
{ {
#ifdef FIONREAD
int avail=0,fd; int avail=0,fd;
fd = FILE_GetUnixHandle(hPipe, GENERIC_READ); fd = FILE_GetUnixHandle(hPipe, GENERIC_READ);
...@@ -555,6 +556,7 @@ BOOL WINAPI PeekNamedPipe( HANDLE hPipe, LPVOID lpvBuffer, DWORD cbBuffer, ...@@ -555,6 +556,7 @@ BOOL WINAPI PeekNamedPipe( HANDLE hPipe, LPVOID lpvBuffer, DWORD cbBuffer,
*lpcbAvail= avail; *lpcbAvail= avail;
return TRUE; return TRUE;
} }
#endif /* defined(FIONREAD) */
SetLastError(ERROR_CALL_NOT_IMPLEMENTED); SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
FIXME("function not implemented\n"); FIXME("function not implemented\n");
......
...@@ -249,8 +249,44 @@ typedef struct ...@@ -249,8 +249,44 @@ typedef struct
#endif /* __EMX__ */ #endif /* __EMX__ */
#ifdef __CYGWIN__
#if defined(linux) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__EMX__) /* FIXME: This section is just here so it can compile, it's most likely
* completely wrong. */
typedef struct
{
unsigned short sc_gs, __gsh;
unsigned short sc_fs, __fsh;
unsigned short sc_es, __esh;
unsigned short sc_ds, __dsh;
unsigned long sc_edi;
unsigned long sc_esi;
unsigned long sc_ebp;
unsigned long sc_esp;
unsigned long sc_ebx;
unsigned long sc_edx;
unsigned long sc_ecx;
unsigned long sc_eax;
unsigned long sc_trapno;
unsigned long sc_err;
unsigned long sc_eip;
unsigned short sc_cs, __csh;
unsigned long sc_eflags;
unsigned long esp_at_signal;
unsigned short sc_ss, __ssh;
unsigned long i387;
unsigned long oldmask;
unsigned long cr2;
} SIGCONTEXT;
#define HANDLER_DEF(name) void name( int __signal, SIGCONTEXT __context )
#define HANDLER_CONTEXT (&__context)
#endif /* __CYGWIN__ */
#if defined(linux) || defined(__NetBSD__) || defined(__FreeBSD__) ||\
defined(__OpenBSD__) || defined(__EMX__) || defined(__CYGWIN__)
#define EAX_sig(context) ((context)->sc_eax) #define EAX_sig(context) ((context)->sc_eax)
#define EBX_sig(context) ((context)->sc_ebx) #define EBX_sig(context) ((context)->sc_ebx)
......
...@@ -49,7 +49,7 @@ inline static BOOL is_stock_font( HFONT font ) ...@@ -49,7 +49,7 @@ inline static BOOL is_stock_font( HFONT font )
* Scale builtin font to requested lfHeight * Scale builtin font to requested lfHeight
* *
*/ */
inline static float round(float f) inline static float Round(float f)
{ {
return (f > 0) ? (f + 0.5) : (f - 0.5); return (f > 0) ? (f + 0.5) : (f - 0.5);
} }
...@@ -73,15 +73,15 @@ static VOID ScaleFont(const AFM *afm, LONG lfHeight, PSFONT *font, ...@@ -73,15 +73,15 @@ static VOID ScaleFont(const AFM *afm, LONG lfHeight, PSFONT *font,
(float)(wm->usWinAscent + wm->usWinDescent); (float)(wm->usWinAscent + wm->usWinDescent);
} }
font->size = (INT)round(font->fontinfo.Builtin.scale * (float)wm->usUnitsPerEm); font->size = (INT)Round(font->fontinfo.Builtin.scale * (float)wm->usUnitsPerEm);
usUnitsPerEm = (USHORT)round((float)(wm->usUnitsPerEm) * font->fontinfo.Builtin.scale); usUnitsPerEm = (USHORT)Round((float)(wm->usUnitsPerEm) * font->fontinfo.Builtin.scale);
sAscender = (SHORT)round((float)(wm->sAscender) * font->fontinfo.Builtin.scale); sAscender = (SHORT)Round((float)(wm->sAscender) * font->fontinfo.Builtin.scale);
sDescender = (SHORT)round((float)(wm->sDescender) * font->fontinfo.Builtin.scale); sDescender = (SHORT)Round((float)(wm->sDescender) * font->fontinfo.Builtin.scale);
sLineGap = (SHORT)round((float)(wm->sLineGap) * font->fontinfo.Builtin.scale); sLineGap = (SHORT)Round((float)(wm->sLineGap) * font->fontinfo.Builtin.scale);
usWinAscent = (USHORT)round((float)(wm->usWinAscent) * font->fontinfo.Builtin.scale); usWinAscent = (USHORT)Round((float)(wm->usWinAscent) * font->fontinfo.Builtin.scale);
usWinDescent = (USHORT)round((float)(wm->usWinDescent) * font->fontinfo.Builtin.scale); usWinDescent = (USHORT)Round((float)(wm->usWinDescent) * font->fontinfo.Builtin.scale);
sAvgCharWidth = (SHORT)round((float)(wm->sAvgCharWidth) * font->fontinfo.Builtin.scale); sAvgCharWidth = (SHORT)Round((float)(wm->sAvgCharWidth) * font->fontinfo.Builtin.scale);
tm->tmAscent = (LONG)usWinAscent; tm->tmAscent = (LONG)usWinAscent;
tm->tmDescent = (LONG)usWinDescent; tm->tmDescent = (LONG)usWinDescent;
...@@ -125,7 +125,7 @@ static VOID ScaleFont(const AFM *afm, LONG lfHeight, PSFONT *font, ...@@ -125,7 +125,7 @@ static VOID ScaleFont(const AFM *afm, LONG lfHeight, PSFONT *font,
font->fontinfo.Builtin.scale *= (float)wm->usUnitsPerEm / 1000.0; font->fontinfo.Builtin.scale *= (float)wm->usUnitsPerEm / 1000.0;
tm->tmMaxCharWidth = (LONG)round( tm->tmMaxCharWidth = (LONG)Round(
(afm->FontBBox.urx - afm->FontBBox.llx) * font->fontinfo.Builtin.scale); (afm->FontBBox.urx - afm->FontBBox.llx) * font->fontinfo.Builtin.scale);
font->underlinePosition = afm->UnderlinePosition * font->fontinfo.Builtin.scale; font->underlinePosition = afm->UnderlinePosition * font->fontinfo.Builtin.scale;
......
...@@ -34,7 +34,7 @@ struct _stat { ...@@ -34,7 +34,7 @@ struct _stat {
short st_uid; short st_uid;
short st_gid; short st_gid;
_dev_t st_rdev; _dev_t st_rdev;
_off_t st_size; MSVCRT(_off_t) st_size;
MSVCRT(time_t) st_atime; MSVCRT(time_t) st_atime;
MSVCRT(time_t) st_mtime; MSVCRT(time_t) st_mtime;
MSVCRT(time_t) st_ctime; MSVCRT(time_t) st_ctime;
...@@ -59,9 +59,9 @@ struct _stati64 { ...@@ -59,9 +59,9 @@ struct _stati64 {
extern "C" { extern "C" {
#endif #endif
int _fstat(int,struct _stat*); int MSVCRT(_fstat)(int,struct _stat*);
int MSVCRT(_stat)(const char*,struct _stat*);
int _fstati64(int,struct _stati64*); int _fstati64(int,struct _stati64*);
int _stat(const char*,struct _stat*);
int _stati64(const char*,struct _stati64*); int _stati64(const char*,struct _stati64*);
int _wstat(const WCHAR*,struct _stat*); int _wstat(const WCHAR*,struct _stat*);
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
typedef unsigned int _dev_t; typedef unsigned int _dev_t;
typedef unsigned short _ino_t; typedef unsigned short _ino_t;
typedef int _off_t; typedef int MSVCRT(_off_t);
typedef long MSVCRT(time_t); typedef long MSVCRT(time_t);
......
...@@ -37,7 +37,7 @@ libwine_tsx11.a: $(OBJS) ...@@ -37,7 +37,7 @@ libwine_tsx11.a: $(OBJS)
$(RANLIB) $@ $(RANLIB) $@
libwine_tsx11.dll: $(OBJS) libwine_tsx11.dll: $(OBJS)
$(DLLWRAP) $(DLLWRAPFLAGS) --export-all --implib libwine_tsx11.a -o libwine_tsx11.dll $(OBJS) $(DLLWRAP) $(DLLWRAPFLAGS) --export-all --implib libwine_tsx11.a -o libwine_tsx11.dll $(OBJS) $(EXTRALIBS)
.PHONY: install_so install_a .PHONY: install_so install_a
......
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